Shape Measuring Device And Shape Measuring Method

ABSTRACT

A shape measuring device includes a stereoscopic-shape-data generating section 212 configured to generate stereoscopic shape data indicating a shape of the measurement object with a pattern projection method, a measurement-setting automatically adjusting section 217 configured to automatically adjust measurement setting for the partial regions on the basis of at least one of stereoscopic shape data of the partial regions and light reception data acquired in the partial regions when the stereoscopic shape data is generated, and a stereoscopic-shape-data coupling section 219 configured to couple, according to the measurement setting for the partial regions adjusted by a measurement setting adjusting section, the stereoscopic shape data of the partial regions generated again by the stereoscopic-shape-data generating section 212 and generate coupled stereoscopic shape data corresponding to the coupled region.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims foreign priority based on Japanese PatentApplication No. 2018-081915, filed Apr. 20, 2018 and No. 2018-134224,filed Jul. 17, 2018, the contents of which is incorporated herein byreference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a shape measuring device and a shapemeasuring method.

2. Description of Related Art

In a two-dimensional or three-dimensional shape measuring device thatmeasures a shape of a measurement object, there is known couplingprocessing for varying positions in an XY direction of an imagingsection and a stage to acquire a plurality of stereoscopic shape dataand coupling the plurality of stereoscopic shape data to thereby acquirehigh-resolution stereoscopic shape data over a wide visual field. Inorder to perform such coupling processing, first, a user designates,using a wide area image, regions that the user desires to couple.Subsequently, the shape measuring device divides the designated regioninto a plurality of divided areas, measures the divided areas in order,and couples an acquired plurality of stereoscopic shape data. In suchcoupling processing, it is necessary to perform measurement setting forperforming measurement (see, for example, JP-A-2014-109492 (PatentLiterature 1)).

In such coupling processing, when the measurement object includes aportion formed by a different material, the user sometimes desires toperform measurement in different measurement setting for each of thedivided areas.

Therefore, a measurement microscope device disclosed in PatentLiterature 1 displays stereoscopic shape data after measurement to theuser. When the user desires to perform the measurement of the dividedarea again, the user can change the measurement setting and executes themeasurement again. When a desired measurement result is obtained, theuser can replace new obtained measurement data as measurement data ofthe divided area.

However, with this method, the user has to determine whetherremeasurement is necessary while confirming a measurement result.Further, the user has to examine how the measurement setting should bechanged to obtain the desired measurement result.

SUMMARY OF THE INVENTION

An object of the present invention is to provide a shape measuringdevice, a shape measuring method, and a shape measuring program and acomputer-readable recording medium capable of automatically determiningand appropriately performing coupling processing.

In order to achieve the above object, a shape measuring device accordingto a first aspect of the present invention includes: a stage on which ameasurement object is placed; alight projecting section configured toirradiate pattern light on the measurement object placed on the stage; alight receiving section configured to receive the pattern lightirradiated from the light projecting section and reflected from themeasurement object and output light reception data; anoptical-axis-direction driving section configured to relatively move thestage in an optical axis direction with respect to the light receivingsection to thereby adjust a focal position of the light receivingsection; a stage-plane-direction driving section configured torelatively move the stage in a stage plane direction orthogonal to anoptical axis direction of the light receiving section; a measurementsetting section for setting measurement setting including lightprojection setting for the pattern light of the light projecting sectionand light reception setting of the light receiving section; acoupled-region setting section configured to set, as a region where arelative position of the stage in the stage plane direction is moved bythe stage-plane-direction driving section, a coupled region formed by aplurality of partial regions; and a control section configured toexecute: stereoscopic-shape-data generation processing for generating,in the partial regions set by the coupled-region setting section,according to the measurement setting set by the measurement settingsection, on the basis of the light reception data output by the lightreceiving section, stereoscopic shape data indicating a shape of themeasurement object with a pattern projection method; measurement-settingadjustment processing for automatically adjusting the measurementsetting for the partial regions on the basis of at least one ofstereoscopic shape data of the partial regions and the light receptiondata acquired in the partial regions when the stereoscopic shape data isgenerated; and stereoscopic-shape-data coupling processing for coupling,according to the measurement setting for the partial regions adjusted bythe measurement-setting adjustment processing, the stereoscopic shapedata of the partial regions generated again by thestereoscopic-shape-data generation processing and generating coupledstereoscopic shape data corresponding to the coupled region. With theconfiguration explained above, it is possible to change the measurementsection for each of the partial regions and generate stereoscopic shapedata. In addition, it is possible to cause the shape measuring device toautomatically perform the adjustment of the measurement setting for eachof the regions. It is possible to perform convenient shape measurement.

According to a second aspect of the present invention, in the shapemeasuring device, in addition to the configuration explained above, thecontrol section may include, as the measurement setting for the partialregions, a measurement mode in generating the stereoscopic shape data ofthe measurement object in the stereoscopic-shape-data generationprocessing, illumination intensity of the light projecting section, anexposure time of the light receiving section, and adjustment of thefocal position of the light receiving section.

Further, according to a third aspect of the present invention, in theshape measuring device, in addition to one of the configurationsexplained above, when detecting at least one of sneaking and multiplereflection of the pattern light from missing data included in thestereoscopic shape data or the light reception data, the control sectionmay select a measurement mode corresponding to the pattern lightsneaking or multiple reflection to make it possible to adjust themeasurement setting for the partial regions. With the configurationexplained above, it is possible to distinguish light sneaking or a voidand automatically adjust the measurement setting for the partialregions.

Furthermore, according to a fourth aspect of the present invention, inthe shape measurement device, in addition to any one of theconfigurations explained above, on the basis of presence or absence of asignal component in a change of a luminance value of a pixel forming thelight reception data, the control section may determine that thesneaking of the pattern light occurs when a fixed signal component isconfirmed and determine that a void is present when the fixed signalcomponent is not confirmed, detect one of sneaking and multiplereflection of light on the basis of a result of the determination, andselect a measurement mode corresponding to the sneaking or the multiplereflection of the light to make it possible to adjust the measurementsetting for the partial regions. With the configuration explained above,it is possible to distinguish the light sneaking or the void on thebasis of a change in a luminance value and automatically adjust themeasurement setting for the partial regions.

Furthermore, according to a fifth aspect, in the shape measuring device,in addition to any one of the configurations explained above, thecontrol section may perform adjustment of an exposure time on the basisof the light reception data to make it possible to adjust themeasurement setting for the partial regions.

Furthermore, according to a sixth aspect of the present invention, inthe shape measuring device, in addition to any one of the configurationsexplained above, the control section may shift the focal position on thebasis of at least one of the light reception data and the stereoscopicshape data to make it possible to adjust the measurement setting for thepartial regions.

Furthermore, according to a seventh aspect of the present invention, inthe shape measuring device, in addition to any one of the configurationsexplained above, the control section may expand a depth measurementrange, which is a height range in which the pattern light can beirradiated from the light projecting section, to make it possible toadjust the measurement setting for the partial regions.

Furthermore, according to an eighth aspect of the present invention, inthe shape measuring device, in addition to any one of the configurationsexplained above, the light projecting section may include: a first lightprojecting section configured to irradiate, from a first direction,first pattern light on the measurement object placed on the stage; and asecond light projecting section configured to irradiate, from a seconddirection, second pattern light on the measurement object placed on thestage. The light receiving section may receive the first pattern lightirradiated from the first light projecting section and reflected fromthe measurement object and output first light reception data and receivethe second pattern light irradiated from the second light projectingsection and reflected from the measurement object and output secondlight reception data. The stereoscopic-shape-data generating processingmay generate first direction stereoscopic shape data of the measurementobject on the basis of the first light reception data received by thelight receiving section and generate second direction stereoscopic shapedata of the measurement object on the basis of the second lightreception data received by the light receiving section. The controlsection may select one or both of the first light projecting section andthe second light projecting section on the basis of the light receptiondata to make it possible to adjust the measurement setting for thepartial regions. With the configuration explained above, an effect ofreducing a time required for measurement during continuous measurementcan be expected.

Furthermore, according to a ninth aspect of the present invention, inthe shape measuring device, in addition to any one of the configurationsexplained above, the shape measuring device may further include ameasurement-setting saving section for saving the measurement settingfor the partial regions adjusted by the control section. The controlsection may couple, according to the measurement setting for the partialregions saved in the measurement-setting saving section, thestereoscopic shape data of the partial regions generated again by thestereoscopic-shape-data generation processing and generate the coupledstereoscopic shape data corresponding to the coupled region.

Furthermore, a shape measuring device according to a tenth aspect of thepresent invention includes: a stage on which a measurement object isplaced; a light projecting section configured to irradiate pattern lighton the measurement object placed on the stage; a light receiving sectionconfigured to receive the pattern light irradiated from the lightprojecting section and reflected from the measurement object and outputlight reception data; an optical-axis-direction driving sectionconfigured to relatively move the stage in an optical axis directionwith respect to the light receiving section to thereby adjust a focalposition of the light receiving section; a stage-plane-direction drivingsection configured to relatively move the stage in a stage planedirection orthogonal to an optical axis direction of the light receivingsection; a coupled-region setting section configured to set, as a regionwhere a relative position of the stage in the stage plane direction ismoved by the stage-plane-direction driving section, a coupled regionformed by a plurality of partial regions; a stereoscopic-shape-datagenerating section configured to generate, in the partial regions set bythe coupled-region setting section, according to the measurement settingset by the measurement setting section, on the basis of the lightreception data output by the light receiving section, stereoscopic shapedata indicating a shape of the measurement object with a patternprojection method; a measurement setting section for setting, as partialregion measurement setting, for each of the partial regions, measurementsetting including light projection setting for the pattern light of thelight projecting section and light reception setting for a pattern imageof the light receiving section; a measurement-setting saving section forsaving, in association with the partial regions, partial regionmeasurement setting for the partial regions set by the measurementsetting section; and a stereoscopic-shape-data coupling sectionconfigured to couple, according to the measurement setting for thepartial regions saved in the measurement-setting saving section, thestereoscopic shape data of the partial regions generated again by thestereoscopic-shape-data generating processing and generate coupledstereoscopic shape data corresponding to the coupled region.

Furthermore, according to an eleventh aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude a measurement-mode selecting section for selecting, as ameasurement mode in generating the stereoscopic shape data of themeasurement object in the stereoscopic-shape-data generation processing,any one of a normal mode, a fine mode for performing finer measurementthan the normal mode, and a halation removal mode for removing halationfrom the light reception data.

Furthermore, according to a twelfth aspect of the present invention, inthe shape measuring device, in addition to anyone of the configurationsexplained above, the stereoscopic-shape-data generating section may becapable of switching a normal measurement mode for changing partialregion measurement setting for each of the partial regions with thecontrol section and generating the stereoscopic shape data and acontinuous measurement mode for reading out, for each of the partialregions, the partial region measurement setting saved in themeasurement-setting saving section in advance and generating thestereoscopic shape data.

Furthermore, according to a thirteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude a guiding section configured to output a guiding message todispose the measurement object on the stage in a same position and asame posture as a reference posture, which is a position and a postureof the measurement object during the acquisition of the measurementsetting for the partial regions saved in the measurement-setting savingsection.

Furthermore, according to a fourteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude a measurement-object-position-and-posture detecting sectionconfigured to detect a position and a posture of the measurement objectplaced on the stage. The shape measuring device may drive thestage-plane-direction driving section to adjust, on the basis of aposition and a posture of the measurement object during the acquisitionof the measurement setting for the partial regions saved in themeasurement-setting saving section, the position and the posture of themeasurement object detected by themeasurement-target-position-and-posture detecting section.

Furthermore, according to a fifteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude a positioning jig for matching a position and a posture of themeasurement object placed on the stage with a position and a posture ofthe measurement object during the acquisition of the measurement settingfor the partial regions saved in the measurement-setting saving section.

Furthermore, according to a sixteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude a texture-image acquiring section for acquiring a texture image,which is a two-dimensional optical image, having texture information ofthe measurement object placed on the stage. At least a part of textureimage capturing conditions in capturing a plurality of texture imageswith the texture-image acquiring section may be common to the partialregions. With the configuration explained above, it is possible to makeit easy to perform comparison and coupling by fixing brightness and thelike concerning the texture image irrespective of the partial regionswhile optimizing the stereoscopic shape data for each of the partialregions. It is possible to make the texture image capturing conditionssuitable for measurement.

Furthermore, according to a seventeenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, as one of the texture image capturingconditions in capturing a plurality of texture images with thetexture-image acquiring section, an exposure time may be common to thepartial regions. As one kind of the partial region measurement settingin generating a plurality of stereoscopic shape data with thestereoscopic-shape-data generation processing, the exposure time may beadjustable by the control section. With the configuration explainedabove, appropriate measurement is realized by adjusting the stereoscopicshape data to brightness suitable for the shape measurement whilemaintaining brightness of the texture images constant to make brightnesscommon.

Furthermore, according to an eighteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the optical-axis-direction drivingsection may independently adjust relative positions in an optical axisdirection of the stage in capturing a plurality of texture images withthe texture-image acquiring section and relative positions in theoptical axis direction of the stage in generating a plurality ofstereoscopic shape data with the stereoscopic-shape-data generationprocessing. With the configuration explained above, it is possible toperform imaging and measurement suitable for the texture images and thestereoscopic shape data by adjusting focal positions independently forthe texture images and the stereoscopic shape data.

Furthermore, according to a nineteenth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude: a determination processing section configured to determine, onthe basis of the stereoscopic shape data acquired by thestereoscopic-shape-data generating section, according to predetermineddetermination conditions, whether an unmeasured region not having heightinformation is present in the depth measurement range; a focal-positionchanging section configured to control the optical-axis-directiondriving section to change the focal position of the light receivingsection when it is determined by un-measurement determination processingby the determination processing section that the unmeasured region ispresent; and a synthesis processing section configured to generate asynthesized stereoscopic shape data obtained by combining a plurality ofstereoscopic shape data generated by automatically repeatingstereoscopic-shape-data acquisition processing by thestereoscopic-shape-data generating section, the un-measurementdetermination processing by the determination processing section, andfocal-position changing processing by the focal-position changingsection until it is determined by the un-measurement determinationprocessing by the determination processing section that an unmeasuredregion is absent or a predetermined end condition is satisfied.

Furthermore, according to a twentieth aspect of the present invention,in the shape measuring device, in addition to any one of theconfigurations explained above, the stereoscopic shape data may be aheight image including height information.

Furthermore, a shape measuring method according to a twenty-first aspectof the present invention is a shape measuring method for performingmeasurement of a shape of a measurement object, the shape measuringmethod including: dividing an image showing a measurement object placedon a stage into a plurality of partial regions and relatively moving thestage with a stage-plane-direction driving section in a stage planedirection orthogonal to an optical axis direction of a light receivingsection to a first region, which is one of the plurality of dividedpartial regions; projecting pattern light on the measurement object froma light projecting section according to first region measurementsetting, which is measurement setting including light projection settingfor the pattern light of the light projecting section and lightreception setting of the light receiving section in the first region,receiving the pattern light reflected from the measurement object withthe light receiving section and acquiring first light reception data,and generating, on the basis of the first light reception data, with astereoscopic-shape-data generating section, first stereoscopic shapedata indicating a shape of the first region with a pattern projectionmethod; saving the first stereoscopic shape data or the first lightreception data in a storing section in association with the first regionand automatically adjusting, with a measurement-setting automaticallyadjusting section, the first region measurement setting to optimizedfirst region adjusted measurement setting on the basis of the firststereoscopic shape data or the first light reception data; relativelymoving the stage with a stage-plane-direction driving section to asecond region, which is another one of the partial regions; projectingthe pattern light on the measurement object from the light projectingsection according to second region measurement setting, which ismeasurement setting including light projection setting for the patternlight of the light projecting section and light reception setting of thelight receiving section in the second region, receiving the patternlight reflected from the measurement object with the light receivingsection and acquiring second light reception data, and generating, onthe basis of the second light reception data, with thestereoscopic-shape-data generation processing, second stereoscopic shapedata indicating a shape of the second region with the pattern projectionmethod; saving the second stereoscopic shape data or the second lightreception data in the storing section in association with the secondregion and automatically adjusting, with a control section, the secondregion measurement setting to optimized second region adjustedmeasurement setting on the basis of the second stereoscopic shape dataor the second light reception data; and coupling, according to apositional relation among the partial regions, a plurality ofstereoscopic shape data including the first stereoscopic shape data andthe second stereoscopic shape data saved in the storing section andgenerating, with a stereoscopic-shape-data coupling section, coupledstereoscopic shape data corresponding to the coupled region.Consequently, it is possible to change measurement setting for each ofthe partial regions and generate stereoscopic shape data. In addition,it is possible to cause the shape measuring device to automaticallyperform adjustment of the measurement setting for each of the partialregion. It is possible to perform convenient shape measurement.

Furthermore, according to a twenty-second aspect of the presentinvention, in the shape measuring method, in addition to theconfiguration explained above, the control section may include, as thefirst region adjusted measurement setting, a measurement mode ingenerating the stereoscopic shape data of the measurement object in thestereoscopic-shape-data generation processing on the basis of the firststereoscopic shape data or the first light reception data, illuminationintensity of the light projecting section, an exposure time of the lightreceiving section, and adjustment of the focal position of the lightreceiving section.

Furthermore, according to a twenty-third aspect of the presentinvention, in the shape measuring method, in addition to one of theconfigurations explained above, the control section may automaticallyadjust, as one kind of the first region measurement setting, an exposuretime of the light receiving section on the basis of the first lightreception data.

Furthermore, according to a twenty-fourth aspect of the presentinvention, in the shape measuring method, in addition to any one of theconfigurations explained above, the control section may automaticallyadjust, as one kind of the first region adjusted measurement setting, onthe basis of missing data included in the first stereoscopic shape dataor the first light reception data, the first region measurement settingto reduce occurrence of the missing data.

Furthermore, according to a twenty-fifth aspect of the presentinvention, in the shape measuring method, in addition to anyone of theconfigurations explained above, when detecting at least one of sneakingand multiple reflection of the pattern light on the basis of missingdata included in the first stereoscopic shape data or the first lightreception data, the control section may automatically select, as onekind of the first region adjusted measurement setting, a measurementmode corresponding to the pattern light sneaking or multiple reflection.

Furthermore, according to a twenty-sixth aspect of the presentinvention, in the shape measuring method, in addition to any one of theconfigurations explained above, the shape measuring method may furtherinclude saving, in a measurement-setting saving section, the firstregion measurement setting and second region measurement settingautomatically adjusted for each of the partial regions by the controlsection. Consequently, by saving the automatically adjusted regionmeasurement setting, it is possible to reuse the region measurementsetting when the same measurement object is measured.

Furthermore, according to a twenty-seventh aspect of the presentinvention, in the shape measuring method, in addition to any one of theconfigurations explained above, the shape measuring method may furtherinclude guiding, when a different measurement object is placed on thestage, the different measurement object to be in a same position and asame posture as a reference posture, which is a position and a postureof the measurement object in saved partial region measurement setting.Consequently, when the same measurement object is measured, by measuringthe measurement object in the saved region measurement setting, it ispossible to make it unnecessary to perform work for automaticallyadjusting region setting conditions again.

Furthermore, according to a twenty-eighth aspect of the presentinvention, in the shape measuring method, in addition to any one of theconfigurations explained above, the shape measuring device may furtherinclude: projecting, according to the first region adjusted measurementsetting, the pattern light from the light projecting section on thedifferent measurement object placed in the guided position and postureon the stage, receiving the pattern light reflected on the differentmeasurement object with the light receiving section and acquiring firstadjusted light reception data, and generating, on the basis of the firstadjusted light reception data, in the stereoscopic-shape-data generationprocessing, first adjusted stereoscopic shape data indicating a shape ofthe first region with the pattern projection method; saving the firstadjusted stereoscopic shape data or the first adjusted light receptiondata in a storing section in association with the first region;relatively moving the stage to the second region with thestage-plane-direction driving section; projecting the pattern light onthe different measurement object from the light projecting according tothe second region adjusted measurement setting, receiving the patternlight reflected on the different measurement object with the lightreceiving section and acquiring second light reception adjusted data,generating, on the basis of the second adjusted light reception data,with the stereoscopic-shape-data generation processing, second adjustedstereoscopic shape data indicating a shape of the second region with thepattern projection method; saving the second stereoscopic shape data orthe second light reception data in a storing section in association withthe second region; and coupling, according to a positional relationamong the partial regions, a plurality of adjusted stereoscopic shapedata including the first adjusted stereoscopic shape data and the secondadjusted stereoscopic shape data saved in the storing section andgenerating adjusted coupled stereoscopic shape data corresponding to thecoupled region with a stereoscopic-shape-data coupling section.Consequently, when measurement is performed on a different measurementobject having the same shape, by reading out and using the savedadjusted region adjusted measurement setting, it is possible to performthe measurement while omitting work for adjusting the partial regionmeasurement setting for each of the partial regions. Therefore, there isan advantage that simplified and quick measurement processing can beperformed.

Furthermore, according to a twenty-ninth aspect of the presentinvention, in the shape measuring method, in addition to any one of theconfigurations explained above, the shape measuring method may furtherinclude determining whether left and right light projection is performedfollowing a depth measurement range search in a Z direction.

Furthermore, a shape measuring program according to a thirtieth aspectof the present invention causes a computer to realize: a function ofdividing an image showing a measurement object placed on a stage into aplurality of partial regions and relatively moving the stage with astage-plane-direction driving section in a stage plane directionorthogonal to an optical axis direction of a light receiving section toa first region, which is one of the plurality of divided partialregions; a function of projecting pattern light on the measurementobject from a light projecting section according to first regionmeasurement setting, which is measurement setting including lightprojection setting for the pattern light of the light projecting sectionand light reception setting of the light receiving section in the firstregion, receiving the pattern light reflected from the measurementobject with the light receiving section and acquiring first lightreception data, and generating, on the basis of the first lightreception data, with a stereoscopic-shape-data generating section, firststereoscopic shape data indicating a shape of the first region with apattern projection method; a function of saving the first stereoscopicshape data or the first light reception data in a storing section inassociation with the first region and automatically adjusting, with ameasurement-setting automatically adjusting section, the first regionmeasurement setting to optimized first region adjusted measurementsetting on the basis of the first stereoscopic shape data or the firstlight reception data; a function of relatively moving the stage with astage-plane-direction driving section to a second region, which isanother one of the partial regions; a function of projecting the patternlight on the measurement object from the light projecting sectionaccording to second region measurement setting, which is measurementsetting including light projection setting for the pattern light of thelight projecting section and light reception setting of the lightreceiving section in the second region, receiving the pattern lightreflected from the measurement object with the light receiving sectionand acquiring second light reception data, and generating, on the basisof the second light reception data, with the stereoscopic-shape-datageneration processing, second stereoscopic shape data indicating a shapeof the second region with the pattern projection method; a function ofsaving the second stereoscopic shape data or the second light receptiondata in the storing section in association with the second region andautomatically adjusting, with a control section, the second regionmeasurement setting to optimized second region adjusted measurementsetting on the basis of the second stereoscopic shape data or the secondlight reception data; and a function of coupling, according to apositional relation among the partial regions, a plurality ofstereoscopic shape data including the first stereoscopic shape data andthe second stereoscopic shape data saved in the storing section andgenerating, with a stereoscopic-shape-data coupling section, coupledstereoscopic shape data corresponding to the coupled region. With theconfiguration explained above, it is possible to change measurementsetting for each of the partial regions and generate stereoscopic shapedata. In addition, it is possible to cause the shape measuring device toautomatically perform adjustment of the measurement setting for each ofthe partial region. It is possible to perform convenient shapemeasurement.

A computer-readable recording medium or a device having a shapemeasuring program recorded therein according to a thirty-first aspect ofthe present invention stores the shape measuring program. The recordingmedium includes a CD-ROM, a CD-R, a CD-RW, a flexible disk, a magnetictape, magnetic disks such as an MO, a DVD-ROM, a DVD-RAM, a DVD-R, aDVD+R, a DVD-RW, a DVD+RW, a Blu-ray (registered trademark), and an HDDVD (AOD), an optical disk, a magneto-optical disk, a semiconductormemory, and other media capable of storing computer programs. Thecomputer programs include, besides computer programs stored in therecording medium and distributed, computer programs distributed bydownload through a network line such as the Internet. The recordingmedium includes a device capable of recording the computer programs, forexample, a general-purpose or dedicated device in which the computerprograms are implemented in an executable state in a form of software,firmware, or the like. Processing and functions included in the computerprogram may be executed by program software executable in a computer.Processing of sections may be realized in a form in which hardware suchas a predetermined gate array (an FPGA, an ASIC, or a DSP) or programsoftware and a partial hardware module that realizes a part of elementsof the hardware are mixed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a measurement microscope deviceaccording to a first embodiment of the present invention;

FIG. 2 is a block diagram showing a measurement microscope deviceaccording to a second embodiment of the present invention;

FIG. 3 is a block diagram showing a measurement microscope deviceaccording to a third embodiment of the present invention;

FIG. 4 is a block diagram showing the configuration of an imagingsection shown in FIG. 1;

FIG. 5 is an image diagram showing an example of a GUI of a measurementmicroscope device operation program;

FIG. 6 is a schematic diagram showing an optical system of telecentricboth side light projection;

FIG. 7 is a schematic diagram showing a relation between left and rightlight projection and a measurement range;

FIG. 8 is a side view showing a state in which an upper head and a lowerhead are connected;

FIG. 9 is a flowchart showing a procedure of shape measurement;

FIG. 10 is a flowchart showing a procedure for acquiring a textureimage;

FIG. 11 is a flowchart showing a procedure for performing measurementsetting;

FIG. 12A is a schematic diagram showing a measurement range at height A;

FIG. 12B is a schematic diagram showing a measurement range at height B;

FIG. 12C is a schematic diagram showing a measurement range at height C;

FIGS. 13A to 13C are image diagrams respectively showing optical imagesobtained at the heights of FIGS. 12A to 12C;

FIGS. 13D to 13F are image diagrams respectively showing stripe imagesobtained at the heights of FIGS. 12A to 12C;

FIG. 14A is a schematic diagram showing a measurement result obtained atthe height A of FIG. 12A;

FIG. 14B is a schematic diagram showing a measurement result obtained atthe height B of FIG. 12B;

FIG. 14C is a schematic diagram showing a measurement result obtained atthe height C of FIG. 12C;

FIG. 14D is a schematic diagram showing a state in which the measurementresults are coupled;

FIG. 15A is an image diagram of a synthesized image in which data in adepth search range is not displayed;

FIG. 15B is an image diagram of a synthesized image in which the data inthe depth search range is displayed;

FIG. 16A is an image diagram of a synthesized image in which data in thedepth search range of another measurement object is not displayed;

FIG. 16B is an image diagram of a synthesized image in which the data inthe depth search range is displayed;

FIG. 17 is an image diagram showing a state in which a stripe image canbe confirmed in a height position of a measurement object present in thedepth search range outside a measurable height range;

FIG. 18 an image diagram showing a state in which a stripe image can beconfirmed in the height position present in the depth search rangeoutside the measurable height range with respect to another measurementobject;

FIG. 19 is a graph showing a relation between roughness of an image anda pitch during coupling;

FIG. 20 is a schematic diagram for explaining a depth search range forautomatically determining a coupled measurement range;

FIG. 21 is a schematic diagram showing a state in which acquired pixelsare accumulated;

FIGS. 22A to 22D are schematic diagrams showing transition of acumulative image;

FIG. 23 is a flowchart showing a procedure of automatic depth expansion;

FIGS. 24A to 24D are schematic diagrams for explaining automatic depthexpansion according to an example 2;

FIG. 25 is an image diagram showing a user interface screen of a fullauto mode of a shape measuring program;

FIG. 26 is an image diagram showing an example in which measurement modeselection is performed;

FIG. 27 is an image diagram showing an example in which depth expansionmode selection is performed;

FIG. 28 is an image diagram showing an example in which measurementdirection selection is performed;

FIG. 29 is an image diagram showing an example in which measurementbrightness setting is performed;

FIG. 30 is a flowchart showing a procedure of manual depth expansion;

FIG. 31A is an image diagram showing an optical image A in which ameasurement object is displayed;

FIG. 31B is an image diagram showing an optical image B in a focalposition higher than a focal position in FIG. 31A;

FIG. 31C is an image diagram showing an optical image C in a focalposition higher than the focal position in FIG. 31B;

FIG. 31D is an image diagram showing a height image D shown in FIG. 31A;

FIG. 31E is an image diagram showing a height image E shown in FIG. 31B;

FIG. 31F is an image diagram showing a height image F shown in FIG. 31C;

FIG. 31G is an image diagram showing a synthesized height image Gobtained by combining the height images shown in FIGS. 31D, 31E, and31F;

FIG. 32 is an image diagram showing a setting example of partialregions;

FIG. 33 is an image diagram showing an optical image of a measurementobject shown in FIG. 32;

FIG. 34A is an image diagram of a height image generated in a normalmeasurement mode from the measurement object shown in FIG. 33;

FIG. 34B is an image diagram of a height image generated in areflection/sneaking light removal mode;

FIG. 35A is an image diagram of a stripe image of a certain measurementobject;

FIG. 35B is a luminance profile of a metal portion in the measurementobject shown in FIG. 35A;

FIG. 35C is a luminance profile of a hole portion;

FIG. 35D is a luminance profile of a white resin portion;

FIG. 36 is a flowchart showing a procedure of automatic image XYcoupling processing;

FIGS. 37A to 37C are image diagrams showing a state in which a map imageis created in a swirl shape;

FIGS. 38A to 38C are image diagrams showing a method of manuallydesignating a coupled region;

FIG. 39 is an image diagram showing a method of automatically setting acoupled region;

FIG. 40 is a flowchart showing a procedure for starting measurementafter determining a coupled region in a map image;

FIG. 41 is a flowchart showing a procedure for setting a coupled regionwhile analyzing stereoscopic shape data during measurement;

FIG. 42 is a flowchart showing a procedure for automatically adjustingpartial region measurement setting and generating synthesizedstereoscopic shape data;

FIG. 43 is a side view showing a state in which a plurality of partialregions are set on a measurement object;

FIG. 44 is a table showing partial region measurement setting for eachof divided measurement regions shown in FIG. 43;

FIG. 45 is a schematic diagram showing a state in which image couplingis performed in a swirl shape;

FIG. 46 is a flowchart showing a generation procedure for a navigationimage;

FIG. 47A is a generated navigation image;

FIG. 47B is a binary image of FIG. 47A;

FIG. 48A is an image diagram of a texture image of a certainphotographing visual field;

FIG. 48B is an image diagram of an image obtained by reducing FIG. 48Ain size and reducing noise;

FIG. 48C is an image diagram of a Sobel filter image of in FIG. 48B;

FIG. 48D is an image diagram of a binary image of FIG. 48C;

FIG. 48E is an image diagram of a binary image obtained by performingimage processing of FIG. 48D;

FIG. 49 is a schematic diagram showing a state in which a rectangularregion set in FIG. 47A is moved;

FIG. 50 is an image diagram showing a 3D measurement screen on which ameasurement region setting window is displayed;

FIG. 51 is an image diagram showing a screen halfway in map imagecreation;

FIG. 52 is an image diagram showing a map image creation screen;

FIG. 53 is an image diagram showing an XY-coupled region setting screen;

FIG. 54 is an image diagram showing the XY-coupled region settingscreen;

FIG. 55 is an image diagram showing a 3D measurement screen;

FIG. 56 is an image diagram halfway in generation of a coupled heightimage (a map image);

FIG. 57 is an image diagram showing a 3D preview screen;

FIG. 58 is an image diagram showing a texture image preview screen;

FIG. 59 is an image diagram showing a height image preview screen;

FIG. 60 is an image diagram showing an edge extraction screen;

FIG. 61 is an image diagram showing a state in which extracted edges aredisplayed on a texture image shown in FIG. 60;

FIG. 62 is an image diagram showing an edge extraction screen;

FIG. 63 is an image diagram showing the edge extraction screen;

FIG. 64 is an image diagram showing the edge extraction screen;

FIG. 65 is an image diagram showing the edge extraction screen;

FIG. 66 is an image diagram showing the edge extraction screen; and

FIG. 67 is an image diagram showing the edge extraction screen.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention are explained below with referenceto the drawings. However, the embodiments explained below areillustrations of a shape measuring device, a shape measuring method, ashape measuring program, and a computer-readable recording medium forembodying the technical idea of the present invention. The presentinvention does not limit the shape measuring device, the shape measuringmethod, the shape measuring program, and the computer-readable recordingmedium to those explained below. This specification does not limitmembers described in the claims to members described in the embodiments.In particular, dimensions, materials, shapes, relative disposition, andthe like of components described in the embodiments are not meant tolimit the scope of the present invention to only the dimensions, thematerials, the shapes, the relative disposition, and the like unlessparticularly specifically described otherwise and are mere explanationexamples. Sizes, positional relations, and the like of members shown inthe drawings are sometimes exaggerated in order to clarify explanation.Further, in the following explanation, the same names and the same signsindicate the same or homogenous members. Detailed explanation of themembers is omitted as appropriate. Further, as elements configuring thepresent invention, a plurality of elements may be configured by the samemember and one member may be used as the plurality of elements.Conversely, a function of one member may be shared and realized by aplurality of members.

In this specification, a “texture image” is an observation image havingtexture information represented by an optical image. On the other hand,a “height image” is an image called a distance image or the like as welland is used in a meaning of an image including height information.Examples of the “height image” include an image displayed as atwo-dimensional image by converting the height information intoluminance, chromaticity, and the like and an image displayed in athree-dimensional shape by converting the height information into Zcoordinate information. A three-dimensional synthesized image obtainedby sticking the texture image to such a height image as textureinformation is also included in the height image. In this specification,a display form of the height image is not limited to two-dimensionaldisplay and includes three-dimensional display. Examples of the displayform include display of a two-dimensional image obtained by convertingthe height information of the height image into luminance and the likeand three-dimensional display of the height information as the Zcoordinate information.

Further, in this specification, a “posture” for placing a measurementobject on a stage means a rotation angle of the measurement object. Whenthe measurement object has a point-symmetrical shape in a plan view likea cone, the same result is obtained irrespective of a rotation angle.Therefore, it is unnecessary to specify the posture.

In the embodiments explained below, an example is explained in which ameasurement method based on triangulation for, in order to acquireheight information of a measurement object, irradiating structuredillumination on the measurement object and using a stripe projectionimage obtained from reflected light reflected on the surface of themeasurement object. However, the present invention does not limit aprinciple and a configuration for acquiring the height information ofthe measurement object to the measurement method. It is also possible toapply other methods, for example, a triangulation system in which a linelaser is used instead of the stripe projection and a slice stack systemthat makes use of a confocal/interference principle.

First Embodiment

A block diagram showing the configuration of a shape measuring deviceaccording to a first embodiment of the present invention is shown inFIG. 1. A shape measuring device 500 includes, as shown in FIG. 1, animaging section 100, a control section 200, a light source section 300,a display section 400, and an operation device 450. This configurationis an example. Members and functional blocks included in the members canbe integrated or divided as appropriate. For example, the light sourcesection may be included in the control section. The control section maybe divided into a controller and a general-purpose computer.

Imaging Section 100

The imaging section 100 includes a light projecting section 110, a lightreceiving section 120, a measurement control section 150, a stage 140,an optical-axis-direction driving section 146, and astage-plane-direction driving section 148. The light projecting section110 is a member for irradiating pattern light on a measurement object WKplaced on the stage 140. The light receiving section 120 receives thepattern light irradiated from the light projecting section 110 andreflected on the measurement object WK and outputs light reception data.The measurement control section 150 is a member for driving the lightprojection of the light projecting section 110 and the light receptionof the light receiving section 120 and outputting the light receptiondata of the light receiving section 120. The imaging section 100measures a shape of the measurement object WK on the basis of a patternprojection method.

Second Embodiment

In an example shown in FIG. 1, a pattern light projecting system thatprojects measurement light for acquiring a height image and anillumination light projecting system that irradiates illumination lightfor capturing a texture image are separately provided. However, thepresent invention is not limited to a configuration in which the lightprojecting systems are separately provided. A light projecting systemmay be used in common. An example of such a light projecting system isshown in a block diagram of FIG. 2 as a second embodiment. In a shapemeasuring device 500B shown in FIG. 2, the same members as the membersshown in FIG. 1 are denoted by the same reference numerals and signs.Detailed explanation of the members is omitted as appropriate.

Compared with the shape measuring device 500 shown in FIG. 1, the shapemeasuring device 500B according to the second embodiment does notinclude an illumination-light output section and an illumination lightsource for observation. In the shape measuring device 500B, the lightprojecting section 110 irradiates illumination light as well. Forexample, the light projecting section 110 can be used as a planar lightsource and irradiate the same light as the illumination light byirradiating all patterns as lighting in projecting the patterns. Withthis configuration, since the illumination-light output section can beomitted, there is an advantage that the configuration of the shapemeasuring device can be simplified.

On the other hand, the stage 140 is a member for placing the measurementobject WK. The optical-axis-direction driving section 146 is a memberfor relatively moving the stage 140 in an optical axis direction withrespect to the light receiving section 120 to thereby adjust a focalposition of the light receiving section 120. In this example, theoptical-axis-direction driving section 146 functions as a focusadjusting section that drives the stage 140 side and adjusts a focallength. The optical-axis-direction driving section 146 includes a stagedriving section that electrically drives the stage 140 and a stageoperation section for manually operating the stage 140. Details of thesesections are explained below.

The stage-plane-direction driving section 148 is a member for relativelymoving the stage 140 in a stage plane direction orthogonal to theoptical axis direction of the light receiving section 120. Thestage-plane-direction driving section 148 is a driving section thatdrives the stage 140 in a horizontal plane. The stage-plane-directiondriving section 148 can adjust a visual field range. In an example inwhich the stage 140 side is driven, the stage-plane-direction drivingsection 148 is equivalent to an XY stage 141 and theoptical-axis-direction driving section 146 is equivalent to a Z stage142.

Third Embodiment

However, the present invention does not limit the optical-axis-directiondriving section 146 to the movement of the stage 140 side. Theoptical-axis-direction driving section 146 may move the light projectingsection 110 and light receiving section 120 side. Such an example isshown in a block diagram of FIG. 3 as a shape measuring device accordingto a third embodiment. In a shape measuring device 500C shown in FIG. 3,the same members as the members shown in FIG. 1 and the like are denotedby the same reference numerals and signs. Detailed explanation of themembers is omitted.

In the shape measuring device 500C according to the third embodiment,the height on the stage 140 side is fixed in an imaging section 100C. Anoptical-axis-direction driving section 146C moves the light projectingsection 110 and light receiving section 120 side. Theoptical-axis-direction driving section 146C includes an imaging-systemoperation section 144C for manually operating imaging systems such asthe light projecting section 110 and the light receiving section 120 andan imaging-system driving section 145C for electrically driving theimaging systems. With this configuration, it is possible to adjust afocal position in the same manner. It is possible to constantly maintainheight for placing the measurement object WK on the stage 140 by fixingthe height of the stage 140. Therefore, there is an advantage thatplacing work for the measurement object WK can be smoothly performed.Both of the stage side and the projecting section and receiving sectionside may be movable. In this way, in this embodiment, it is possible toadjust the focal position in the depth direction even when one or bothof the stage side and the light projecting section and light receivingsection side are moved. Accordingly, “relatively move the stage in theoptical direction with respect to the light receiving section” in thisspecification includes a form in which the stage side is moved, a formin which the light projecting section and light receiving section sideare moved, and a form in which both of the sides are moved.

Control Section 200

The control section 200 includes a stereoscopic-shape-data generatingsection 212, a three-dimensional-image synthesizing section 213, adetermination processing section 214, a depth-expansion processingsection 215, a synthesis processing section 216, a measurement-settingautomatically adjusting section 217, a stereoscopic-shape-data couplingsection 219, a storing section 240, and a setting section 250.

Measurement-Setting Automatically Adjusting Section 217

The measurement-setting automatically adjusting section 217 is a memberfor automatically adjusting measurement setting of partial regions onthe basis of at least one of stereoscopic shape data of the partialregions and light reception data acquired in the partial regions whenthe stereoscopic shape data is generated. The measurement-settingautomatically adjusting section 217 automatically adjusts partial regionmeasurement setting in the partial regions and changes the partialregion measurement setting to measurement setting of the partial regionsaccording to necessity. When the measurement setting of the partialregions is changed in this way, the stereoscopic-shape-data generatingsection generates stereoscopic shape data again according to themeasurement setting of the partial regions. That is, the lightprojecting section projects pattern light and the light receivingsection receives adjusted light reception data according to themeasurement setting of the partial regions after the adjustment. Thestereoscopic-shape-data generating section generates adjustedstereoscopic shape data on the basis of the adjusted light receptiondata. Further, the stereoscopic-shape-data coupling section 219 couplesthe adjusted stereoscopic shape data and generates coupled adjustedstereoscopic shape data. Consequently, it is possible to generatestereoscopic shape data in measurement setting of the partial regionschanged to optimum conditions on the basis of the once acquired lightreception data and stereoscopic shape data and perform more accuratemeasurement.

Stereoscopic-Shape-Data Coupling Section 219

The stereoscopic-shape-data coupling section 219 is a member forcoupling, according to the measurement setting for the partial regionsadjusted by a measurement-setting adjusting section, the stereoscopicshape data of the partial regions generated again by thestereoscopic-shape-data generation processing and generating coupledstereoscopic shape data corresponding to a coupled region.

Stereoscopic-Shape-Data Generating Section 212

The stereoscopic-shape-data generating section 212 is a member forgenerating, with a pattern projection method, according to themeasurement setting set by a measurement setting section 255 and on thebasis of the light reception data output by the light receiving section,stereoscopic shape data indicating the shape of a measurement object inthe partial regions set by a coupled-region setting section 256. In theexample shown in FIG. 1 and the like, the stereoscopic-shape-datagenerating section 212 acquires, on the basis of a plurality of lightreception data output by the light receiving section 120 by receiving, aplurality of times, light sequentially phase-shifted and projected bythe light projecting section 110 and reflected from the surface of themeasurement object WK, phase data changed according to a surface shapeof the measurement object WK and measures, on the basis of the phasedata, with the pattern projection method, a shape of the measurementobject WK present in a stage plane orthogonal to the optical axis of thelight receiving section 120 and acquires stereoscopic shape data. Thestage plane is designated in a planar shape and designated on, forexample, an XY plane. The stereoscopic shape data is desirably acquiredfor each of pixels. The stereoscopic shape data means data with whichheight information can be measured. For example, a height image, inwhich pixels showing a measurement object indicate three-dimensionalcoordinates of the measurement object, is included in the stereoscopicshape data. That is, the stereoscopic shape data is not always requiredto directly have height information. For example, a stripe imagemeasured by the pattern projection method before measurement of heightinformation, phase data, and data obtained by measuring heightinformation indicating a three-dimensional coordinate (e.g., an XYZcoordinate) of the measurement object for each of pixels from the stripeimage are also included in the stereoscopic shape data.

The stereoscopic-shape-data generating section 212 can also generate aheight image. Therefore, the stereoscopic-shape-data generating section212 can include a height-image generating section 212 b that generates aheight image and a shape-measurement processing section 212 c thatperforms measurement on the height image. In this way, thestereoscopic-shape-data generating section 212 may be configured togenerate a height image, in which the pixels showing the measurementobject indicate the three-dimensional coordinates, included in thestereoscopic shape data.

Determination Processing Section 214

The determination processing section 214 is a member for determining, onthe basis of the stereoscopic shape data acquired by thestereoscopic-shape-data acquiring section 212, according to apredetermined determination condition, whether an unmeasured region nothaving height information is present in a depth measurement range. Inthe pattern projection method, even if contrast of stripe patterns islow, it is possible to acquire stereoscopic shape data if the stripepatterns have contrast enough for distinguishing a bright part and adark part adjacent to each other. Therefore, the depth measurement rangeindicates a range having certain fixed width in the optical axisdirection of the light receiving section 120 in which height informationcan be acquired without relatively moving the stage 140 with respect tothe light receiving section 120 or the light projecting section 110 orboth of the light receiving section 120 and the light projecting section110. More specifically, the depth measurement range has a fixed rangevertically in the optical axis direction with respect to a positionwhere stripe patterns projected on the measurement object WK by thelight projecting section 110 are imaged at the largest contrast. Thefixed range is a range in which the stripe patterns projected from thelight projecting section 110 can be at least imaged by the lightreceiving section 120. When a plurality of the light projecting sections110 that project pattern lights from different directions are present,the fixed range may be defined on the basis of a range in which stripepatterns projected from all the light projecting sections 110 areimaged. The unmeasured region indicates data, height information ofwhich cannot be acquired, in the stereoscopic shape data. Examples ofthe unmeasured region include a region formed by a pixel or a pluralityof pixels on which stripe patterns of stripe projection are notreflected. Examples of the predetermined determination condition includecontrast of a stripe image included in the stereoscopic shape data andwhether luminance has reached a predetermined value.

That is, when a pixel in which a luminance value enough for determiningthat a pattern is projected is obtained is present among pixels forwhich final stereoscopic shape data is not obtained, the determinationprocessing section 214 determines that a measurement target object ispresent, changes the depth measurement range on the basis of thedetermination, and attempts to acquire stereoscopic shape data.

The determination processing section 214 can determine whether anunmeasured region not having height information is present in the depthmeasurement range by determining on the basis of such a determinationcondition whether stripe patterns are obtained enough for performingmeasurement of height.

The determination processing section 214 can accumulate acquired pixelsin which height information can be measured in the depth measurementrange and determine on the basis of a cumulative image obtained byaccumulating the acquired pixels whether an unmeasured pixel is present.

Further, the determination processing section 214 may determine whichpart in the depth measurement range has the stereoscopic shape data anddetermine presence or absence of an unmeasured pixel. In this way, if apixel, the height of which can be measured, is present in the depthmeasurement range, the determination processing section 214 mayautomatically expand depth. That is, if at least one point can bemeasured in the depth measurement range, the determination processingsection 214 can be controlled to expand the depth measurement range.

Depth-Expansion Processing Section 215

The depth-expansion processing section 215 is a member for controllingthe optical-axis-direction driving section 146 and changing the focalposition of the light receiving section 120 when it is determined byun-measurement determination processing by the determination processingsection 214 that an unmeasured region is present.

Setting Section 250

The setting section 250 includes a position designating section 251, anend-condition setting section 252, a depth-range setting section 253, adepth-expansion-mode selecting section 254, a measurement settingsection 255, a coupled-region setting section 256, and ameasurement-mode selecting section 257.

Position Designating Section 251

The position designating section 251 is a member for designating an XYposition on an image of the measurement object WK displayed on thedisplay section 400.

End-Condition Setting Section 252

The end-condition setting section 252 is a member for setting apredetermined end condition for ending focal-position-changingprocessing for controlling the optical-axis-direction driving section146 and changing the focal position of the light receiving section 120.

Examples of the predetermined end condition by the determinationprocessing section 214 include a physical limit of a moving range, thatis, a state in which the stage 140 reaches a position where the stage140 cannot further move. Examples of the predetermined end conditionalso include a state in which a shape is not measured but a stripe imagecannot be acquired besides a state in a shape cannot be measured in thefirst place.

When causing the optical-axis-direction driving section 146 to operate,the depth-expansion processing section 215 desirably causes theoptical-axis-direction driving section 146 to operate in a direction inwhich the distance between the light receiving section 120 and the stage140 increases. Consequently, it is possible to avoid a situation inwhich the measurement object WK placed on the stage 140 comes intocontact with the light receiving section 120. In this case, since thelight receiving section 120 and the stage 140 operate only in onedirection in which the light receiving section 120 and the stage 140separate, unless an initial position of the stage 140 is appropriatelyset, the entire measurement object WK cannot be measured. A user sets,while moving the stage 140 in the optical axis direction of the lightreceiving section 120, the initial position of the stage 140 in aposition where measurement of the lowest position (a position where thelight receiving section 120 is away most) of the measurement object WKthat the user desires to measure is possible and a position where thehighest position (a position closest to the light receiving section 120)of the measurement object WK does not collide with the light receivingsection 120. The user can perform this work by confirming thestereoscopic shape data displayed on the display section 400 or visuallyconfirming an actual distance between the stage 140 and the lightreceiving section 120.

On the other hand, the depth-expansion processing section 215 desirablyincludes a mechanism for preventing a situation in which the measurementobject WK on the stage 140 comes into contact with a camera or the likewhen the operation of the optical-axis-direction driving section 146 isalso allowed in a direction in which the distance between the lightreceiving section 120 and the stage 140 decreases. For example, roughheight of the highest part of the measurement object WK is acquired inadvance. The operation of the optical-axis direction driving section 146is limited by the depth-expansion processing section 215 to prohibit thelight receiving section 120 and the stage 140 from approaching adistance shorter than the height. When the movement of the stage 140 isallowed in both of the direction in which the distance between the lightreceiving section 120 and the stage 140 decreases and the direction inwhich the distance between the light receiving section 120 and the stage140 increases, first, the stage 140 is moved in one of the directionsfrom the initial position of the stage 140. When the end condition bythe determination processing section 214 is not satisfied, the stage 140is moved in the other direction. This reciprocating operation isperformed until the end condition is satisfied.

The depth-range setting section 253 is a member for setting a range forcontrolling the optical-axis-direction driving section 146 and changingthe focal position of the light receiving section 120.

The depth-expansion-mode selecting section 254 is a member for switchingwhether focal-position-changing processing for controlling theoptical-axis-direction driving section 146 and changing the focalposition of the light receiving section 120 is performed in apredetermined range or the depth is automatically extended.

Measurement Setting Section 255

The measurement setting section 255 is a member for setting a coupledregion. The coupled region is divided into a plurality of partialregions. The partial regions correspond to a visual field measurable bythe shape measuring device or a region slightly narrower than the visualfield. In this way, the coupled region is divided into the plurality ofpartial regions. The stage is moved to the partial regions by theplane-direction driving section. Stereoscopic shape data respectivelygenerated in the partial regions are coupled in the XY plane direction.Consequently, it is possible to obtain a wide area image in which avisual field limited in hardware specification is enlarged.

Coupled-Region Setting Section 256

The coupled-region setting section 256 is a member that sets, as aregion in which a relative position of the stage 140 in the planedirection is moved by the plane-direction driving section, the coupledregion formed by the plurality of partial regions.

Measurement-Mode Selecting Section 257

The measurement-mode selecting section 257 is a member for selecting, asa measurement mode in generating stereoscopic shape data of ameasurement object in the stereoscopic-shape-data generating section,anyone of a normal mode, a fine mode for performing measurement finerthan measurement in the normal mode, and a halation removal mode forremoving halation from light reception data.

Synthesis Processing Section 216

The synthesis processing section 216 is a member for generating asynthesized height image obtained by combining a plurality of heightimages generated by automatically repeating stereoscopic-shape-dataacquisition processing by the stereoscopic-shape-data generating section212, the un-measurement determination processing by the determinationprocessing section 214, and focal-position-changing processing by thedepth-expansion processing section 215 until it is determined by theun-measurement determination processing by the determination processingsection 214 that an unmeasured region is absent or the predetermined endcondition is satisfied.

With such a shape measuring device, it is possible to expand ameasurement range in the depth direction in respective visual fields.

Acquiring Method for Height Information

In this embodiment, the pattern projection method based on the principleof triangulation is used as the method for acquiring height information.In this method, the position of the measurement object or the shapemeasuring device is physically or optically moved and measurement isrepeated on the basis of the triangulation system in which a depthmeasurement range in one time of measurement is wide. By combiningobtained measurement results, it is possible to expand total height inthe depth direction by a distance of movement of the depth measurementrange that can be realized by one time of measurement. As a result, itis possible to quickly measure a wider range than the triangulationsystem. Consequently, the shape measuring device and the shape measuringmethod capable of measuring a wider visual field with higher resolutionare realized.

XY Image Coupling Function

The synthesis processing section 216 can also couple, on the XY plane, aplurality of height images having different XY coordinates captured bymoving the stage 140 in the XY direction. In the case of such XYcoupling, the stage 140 is moved in the horizontal direction by thestage-plane-direction driving section 148. Images captured in differentvisual field ranges are coupled in the horizontal direction. Forexample, texture images showing different parts captured a plurality oftimes by a texture-image acquiring section 218 are coupled by an XYcoupling section. A coupled image serving as a large texture image canbe used as a reference target image and an inspection target image. Inparticular, in a shape measuring device capable of capturing ahigh-magnification optical image and the like, the ability of the shapemeasuring device sometimes cannot be sufficiently exerted with alow-magnification texture image. It is possible to realize highlyaccurate image inspection by generating a high-magnification andhigh-definition texture image with an image coupling function.Alternatively, since a high-magnification image has a narrow visualfield, it is also possible to obtain a coupled image having an enlargedvisual field by coupling images captured in different visual fields. Theimage coupling function, that is, the XY coupling function is notlimitedly executed on the texture image and can also be executed on aheight image and a synthesized height image or a synthesized imageobtained by combining the texture image and the height image. When aplurality of stereoscopic shape data acquired by moving the stage 140 inthe XY direction are coupled, the depth expansion processing by thedepth-expansion processing section 215 is automatically performed inrespective XY positions. A generated plurality of stereoscopic shapedata are coupled. Consequently, even if the measurement object WK islarge in the XY direction and has large undulation in the heightdirection, it is possible to easily perform measurement of the entiremeasurement object WK. When the undulation in the height direction ofthe measurement object WK is different in the XY positions, presence orabsence or the number of times of the depth expansion processing by thedepth-expansion processing section 215 is different in the XY positions.For example, in an XY position where the measurement object WK is ratherflat and the entire measurement object WK falls within the measurementdepth range in one time of measurement, stereoscopic shape data can begenerated without performing the depth expansion processing. In an XYposition where the undulation of the measurement object WK is large andthe depth expansion processing is necessary, stereoscopic shape data isgenerated by performing a plurality of times of the depth expansionprocessing. The stereoscopic shape data can be coupled in the XYdirection.

In executing the image coupling, it is easier to perform work when awide area image of the measurement object is photographed beforehand andthen setting is performed on the wide area image. However, aphotographing visual field imageable in the light receiving section isphysically restricted. Whereas it is necessary to perform photographingat low magnification if a wide visual field is imaged and used, themagnification of the light receiving section is limited. The size of animaging element such as a CCD configuring the light receiving section isalso limited. Further, when the imaging optical system is a telecentricoptical system, since the telecentric optical system does not have anangle of view, a visual field cannot be enlarged even if a workingdistance is increased. Therefore, by changing the photographing visualfield to capture a plurality of images and arranging the plurality ofimages in the XY direction in a tile shape, it is possible to obtain awide area image surpassing the physical restriction of the visual field.Such a wide area image obtained by coupling the plurality of images inthe tile shape is referred to as navigation image herein.

The navigation image can be manually created. However, since it takeslabor and time to manually create the navigation image, it is desirableto automatically create the navigation image. As a method ofautomatically generating the navigation image, there is known a methodof moving the photographing visual field in a swirl shape as shown inFIG. 45. In this swirl coupling method, the user manually locates thephotographing visual field in the center of a measurement object thatthe user desires to image. After an image is captured, images arecaptured and sequentially coupled while the photographing visual fieldis automatically moved in a swirl shape. At a point in time when anentire view of the measurement object is obtained, the user instructs anend of the processing. In this method, first, the user has to manuallyset the photographing visual field in the center of the measurementobject. The user has to instruct an end of the imaging while confirmingan obtained coupled image. Therefore, this method takes labor and time.

Generation Procedure for the Navigation Image

Therefore, in this embodiment, as an automatic creation method for thenavigation image with reduced labor and time, a method of analyzing animage of the measurement object and specifying a moving direction of thephotographing visual field is adopted. Such an automatic creation methodfor the navigation image is explained with reference to FIG. 46 andFIGS. 47A and 47B. A procedure for, in order to obtain a navigationimage shown in FIG. 47A, moving the photographing visual field asindicated by arrows in a binary image shown in FIG. 47B and couplingsequentially captured images to enlarge a visual field is explained withreference to a flowchart of FIG. 46.

Photographing Processing

First, in step S4601, the shape measuring device photographs a textureimage in the present position. The shape measuring device captures atexture image in any position of the measurement object using thetexture-image acquiring section shown in FIG. 1 and the like.Consequently, a texture image in a photographing visual field in thepresent XY stage position shown in FIG. 48A is obtained.

Contour Extraction Processing

Subsequently, in step S4602, the shape measuring device converts thetexture image into a binary image. When converting texture image intothe binary image with the control section, the shape measuring deviceapplies necessary image processing to the texture image. In thisexample, the shape measuring device applies a median filter to thetexture image to reduce noise. Further, the shape measuring devicereduces an image. The shape measuring device reduces the texture imageshown in FIG. 48A to ⅛ to obtain an image shown in FIG. 48B.Subsequently, the shape measuring device applies a horizontal directionSobel filter and a vertical direction Sobel filter to respective R, G,and B images and adds up the R, G, and B images to create a Sobel filterimage shown in FIG. 48C. Further, the shape measuring device creates ahistogram from the Sobel filter image, calculates a threshold ofbinarization from the histogram, and binarizes the Sobel filter image asshown in FIG. 48D. Finally, the shape measuring device performs acontour search, performs processing for painting out the inside of theSobel filter image, and excludes a small contour to obtain a binaryimage shown in FIG. 48E.

The shape measuring device determines a portion having a largedifference as the measurement object using the Sobel filter (adifferential filter). Therefore, a portion, which is not the measurementobject, that is, a top plate on the stage corresponding to a backgroundportion needs to be a texture having a small difference. Therefore, itis desirable to form the top surface of the stage in a flat shape havingless undulation. It is desirable to form the upper surface as a smoothsurface. However, a certain degree of robustness is secured by themedian filter, a reduction in size, exclusion of a small shape, and thelike.

In the example explained above, the Sobel filter is used in order toconvert the texture image into the binary image. However, the presentinvention is not limited to the Sobel filter. Other differential filterssuch as a Prewitt filter can be used.

Extension Determination Processing

The shape measuring device extracts only a contour portion of themeasurement object by converting the texture image into the binaryimage. Subsequently, in step S4603 in FIG. 46, the shape measuringdevice determines, from the binary image, in which of upper, lower,left, and right directions the measurement object extends. The shapemeasuring device saves the position of the measurement object. As shownin FIG. 49, the present photographing visual field of the lightreceiving section is represented as a rectangular region RA1. A state isassumed in which rectangular regions having the same size as thisrectangular region are arranged in an X direction and a Y directionorthogonal to the optical axis of the light receiving section. The shapemeasuring device determines, on the basis of the extracted contour ofthe measurement object, whether the measurement object is present inrectangular regions RA2, RA3, RA4, and RA5 adjacent to the presentphotographing visual field, that is, the rectangular region RA1 amongsuch a plurality of rectangular regions. It is possible to determinepresence or absence of the measurement object according to from whichside to which side the contour extends among four sides forming therectangular region. In an example shown in FIG. 49, it is determinedthat the measurement object is present in all of the rectangular regionsRA2, RA3, RA4, and RA5 located on all sides of the rectangular regionRA1.

Storage Processing

When one or more partial regions where it is determined by thisextension determination processing that the measurement object ispresent are present, the shape measuring device causes the storingsection to store coordinate positions of the partial regions. XYposition information of the rectangular regions RA2, RA3, RA4, and RA5is saved iii an XY position list of a saving section of the storingsection. The XY position information saved in the XY position list maybe coordinates of a rectangular region, for example, coordinates of fourcorners, a coordinate of the center, or a specific coordinate of theupper left or the lower right or may be a moving direction.

Subsequently, in step S4604, the shape measuring device determineswhether the XY position information is included in the XY position list.When the XY position information is included in the XY position list, instep S4605, the shape measuring device moves the photographing visualfield to an XY position closest to the present position in the XYposition list. Since all of the rectangular regions RA2, RA3, RA4, andRA5 are in the same distance, the photographing visual field is moved toany one of the rectangular regions RA2, RA3, RA4, and RA5, for example,the rectangular region RA2. The shape measuring device returns to stepS4601 and repeats the photographing processing, the contour extractionprocessing, the extension determination processing, and the storageprocessing in the same manner. As a result, a visual field of thetexture image is enlarged from the rectangular region RA1 to RA1+RA2.Among the rectangular regions adjacent to the rectangular region RA2,rectangular regions to which the measurement object extends are therectangular regions RA1 and RA6. Since the rectangular region RA1 isalready imaged, the rectangular region RA1 is excluded. XY positioninformation of the rectangular region RA6 is added to the XY positionlist. In this way, in the addition of the XY position information, analready captured XY position is excluded. As a result, the rectangularregions RA3, RA4, RA5, and RA6 are saved in the XY position list. Amongthe rectangular regions RA3, RA4, RA5, and RA6, the rectangular regionclosest to the present rectangular region RA2 is the rectangular regionRA6. Therefore, the photographing visual field is moved to therectangular region RA6 and the same processing is performed. Suchprocessing is continued until the XY position list becomes empty.

When determining in step S4604 that the XY position information is notincluded in the XY position list, the shape measuring device proceeds tostep S4606 and causes the display section to display a coupled image ofthe measurement object. A coupled image obtained by coupling textureimages captured in the rectangular regions as shown in FIG. 47A isdisplayed on the display section as the navigation image. The couplingprocessing for images and the display processing on the display sectionmay be displayed in a state in which a final navigation image isobtained. Besides, the coupling processing and the display processingmay be updated at any time at a point in time when the texture image iscaptured in the rectangular region.

In this way, an image in a wider area than a physical photographingvisual field of the light receiving section can be displayed as thenavigation image. In this state, the user can perform observation andmeasurement, condition setting for the observation and the measurement,and the like, for example, designate a region where the user desires todesignate measurement of stereoscopic shape data. The navigation imageonly has to be a simple image for performing overall display andsetting. Therefore, it is desirable to make it possible to quicklyperform processing such as generation and display by, for example,reducing resolution and magnification. On the other hand, if an imagecaptured according to conditions set on the navigation image is an imagegenerated according to advanced processing for, for example, settinghigher definition and higher magnification or including heightinformation in the image, it is possible to efficiently perform display,setting, and generation of the image. The size of the rectangular regionis set to maximum size or size close to the maximum of the photographingregion determined by the specifications of the light receiving section.In an example shown in FIG. 47B, the navigation image is generated byarranging five rectangular regions and three rectangular regionslaterally and longitudinally in a tile shape. However, the numbers oflateral and longitudinal rectangular regions change according to thesize and the like of the measurement object. In some case, one lateralrectangular region or one longitudinal region is formed.

In a state in which the navigation image is generated, the user candesignate, with an XY-position designating section, any position on thenavigation image. As the XY-position designating section, an inputdevice such as a mouse or a touch panel can be used. It is possible tomove the stage to change the photographing visual field to the positiondesignated by the XY-position designating section in this way.

Image XY Coupling Processing

The shape measuring device can also perform image XY couplingprocessing. For example, as a unit for performing imaging in the lightreceiving section on the navigation image displayed on the displaysection, the shape measuring device sets, with an XY-coupled-regionsetting section, a plurality of partial regions on the XY plane. Thecontrol section generates, for each of the partial regions set by theXY-coupled-region setting section, three-dimensional stereoscopic shapedata on the basis of an image of the measurement object captured by thephotographing processing and couples stereoscopic shape data adjacent toone another to generate coupled stereoscopic shape data in coupled-imagegeneration processing.

Operation Example of a Shape Measuring Program for Generating a CoupledHeight Image

A procedure for generating a navigation image and generating a coupledheight image (a map image) as coupled stereoscopic shape data isexplained with reference to a user interface screen of a shape measuringprogram shown in FIGS. 50 to 59. First, on a 3D measurement screen 600shown in FIG. 50, the shape measuring device displays a texture image ofa measurement object in an image display region 410. In this state, theuser presses a “region setting” button 603 of a measurement-regionsetting window 602 provided in an operation region 420. Consequently,execution of automatic generation of a navigation image is instructed.As shown in FIG. 51, the XY stage is automatically moved. Continuouslyfrom a photographing visual field shown in FIG. 50, the photographingvisual field is automatically switched to a direction in which themeasurement object is present. A new navigation image is captured andcoupled. A state in which the photographing visual field is enlarged inthis way is updated in the image display region 410 on a real-timebasis. A movement amount of the XY stage is desirably set such that theXY stage partially overlaps the preceding photographing visual field 604as shown in FIG. 51. As explained above, the imaging is sequentiallyrepeated and the photographing visual field is enlarged until no XYposition is left in the XY position list. Finally, as shown in FIG. 52,a coupled texture image 605 showing the entire measurement object isgenerated and displayed in the image display region 410. In the displayof the coupled texture image 605, it is desirable to automaticallyadjust display magnification such that the entire view of the coupledtexture image is displayed.

In this way, it is possible to automatically create a navigation imageexceeding a photographing visual field that can be physically imaged ata time. Subsequently, a map image obtained by coupling height images inthis state is created. The map image is automatically captured byrecognizing the shape of the measurement object. In a measurement-regionsetting screen 610 shown in FIG. 52, the user can designate a regionwhere the user desires to create the map image. The user can alsoenlarge the region of the map image. For example, by clicking, in theimage display region 410, the region where the user desires to createthe map image, an image of the designated position is captured and addedto the map image.

An XY-coupled-region setting screen 620 for setting an XY-coupled regionin image coupling is shown in FIG. 53. On this screen, an XY-coupledregion for performing image XY coupling is set. The XY-coupled region isdivided into rectangular partial regions. The divided regions are set tosize, the upper limit of which is the photographing visual field. Forexample, the user displays a rectangular partial region setting frame inthe image display region 410 and adjusts the position and the size ofthe rectangle such that a region that the user desires to measure fitswithin the partial region setting frame. The partial regions can also beautomatically set. In this example, when the user presses a “regionautomatic setting” button 622 provided in the operation region 420, theautomatic setting of the partial regions is executed. Alternatively, theuser can designate the size and the number of the partial regions asnumerical values. The user can designate longitudinal and lateral sizesand longitudinal and lateral numbers of the partial regions from a“size/number designation” field 624. For example, in an example shown inFIG. 53, a state is shown in which only one divided region 626 isdesignated. In an example shown in FIG. 54, a state is shown in which alateral number and a longitudinal number of divided regions 627 arerespectively set to three and four.

Further, the user can also set a mask region where imaging is notperformed. The user can check an “excluded region designation” field 628and designate an excluded region in the image display region 410 in arectangular shape. When ending the setting of the XY-coupled region inthis way, the user presses an OK button 629 and returns to the 3Dmeasurement screen 600 shown in FIG. 55. In this state, the navigationimage and a set measuring instrument are displayed on themeasurement-region setting window 602. When the user presses a“measurement” button 606 in this state, generation of a coupled heightimage (a map image) is started as shown in FIG. 56. When the coupledheight image is generated, a 3D preview screen 630 is displayed as shownin FIG. 57. In this state, the user can optionally adjust the position,the posture, the magnification, and the like of a coupled height image634 displayed in the image display region 410. When the user switches a“3D” button 631 to a “texture” button 632 provided in an upper part ofthe operation region 420, the coupled height image is switched to atexture image 635 as shown in FIG. 58. When the user presses a “height”button 633, the texture image 635 is switched to a height image 636 asshown in FIG. 59. In this way, it is possible to generate coupledstereoscopic shape data having height information. Therefore, it ispossible to operate an analysis, saving of image data, partial retaking,or the like according to necessity.

Further, such image XY coupling processing can also be automaticallyperformed other than being manually performed. For example, the shapemeasuring device performs, with the control section, partial-regionsetting processing for automatically setting a plurality of partialregions on the XY plane as a unit for performing imaging with the lightreceiving section on the navigation image displayed on the displaysection. For each of the partial regions set in the partial-regionsetting processing, as coupled-image generation processing, the shapemeasuring device generates three-dimensional stereoscopic shape data onthe basis of images of the measurement object photographed by thephotographing processing and couples stereoscopic shape data adjacent toone another to generate coupled stereoscopic shape data in coupled-imagegeneration processing.

The storing section 240 is a member for saving various data and storingsetting values. A semiconductor storage device or the like can be usedas the storing section 240. The storing section 240 includes aheight-image storing section 241 that saves a height image, atexture-image storing section 242 that saves a texture image, and ameasurement-setting saving section 243 for saving measurement setting ofpartial regions adjusted by the measurement-setting automaticallyadjusting section 217.

The display section 400 is a member for displaying an acquired image orthe like. For example, an LCD, an organic EL, or a CRT can be used asthe display section 400.

The operation device 450 is a member for receiving, for example, aninput of the user. An input device such as a mouse, a keyboard, or aconsole can be used as the operation device 450. By using a touch panelin the display section 400, the display section 400 can also be used asan operation device.

Block Diagram

A configuration example of the imaging section 100 of the shapemeasuring device 500 shown in FIG. 1 is shown in a block diagram of FIG.4. The imaging section 100 includes the light projecting section 110,the light receiving section 120, an illumination-light output section130, the stage 140, and the measurement control section 150. The lightprojecting section 110 includes a measurement light source 111, apattern generating section 112, and a plurality of lenses 113, 114, and115. The light receiving section 120 includes a camera 121 and aplurality of lenses 122 and 123. The measurement object WK is placed onthe stage 140.

Light Projecting Section 110

The light projecting section 110 is disposed obliquely above the stage140. The imaging section 100 may include a plurality of light projectingsections 110. In the example shown in FIG. 4, the imaging section 100includes two light projecting sections 110. A first light projectingsection 110A (on the right side in FIG. 4) capable of irradiatingpattern line on the measurement object WK from a first direction and asecond light projecting section 110B (on the left side in FIG. 4)capable of irradiating pattern light on the measurement object WK from asecond direction different from the first direction are respectivedisposed. The first light projecting section 110A and the second lightprojecting section 110B are symmetrically disposed across the opticalaxis of the light receiving section 120. Three or more light projectingsections may be provided or only one light projecting section may beprovided.

Alternatively, it is also possible to project light while varying adirection of illumination by relatively moving the light projectingsection and the stage. Further, in the example shown in FIG. 4, anirradiation angle of illumination light projected by the projectingsection 110 with respect to the vertical direction is fixed. However,the irradiation angle can be varied.

The light receiving section 120 shown in FIG. 4 receives first patternlight irradiated from the first light projecting section 110A andreflected from the measurement object WK and outputs first lightreception data. On the other hand, the light receiving section 120receives second pattern light irradiated from the second lightprojecting section 110B and reflected from the measurement object WK andoutputs second light reception data. The light reception data output bythe light receiving section 120 is, for example, a stripe image based ona fringe projection method.

The stereoscopic-shape-data acquiring section 212, which receives thelight reception data, generates a first height image of the measurementobject WK on the basis of the first light reception data received by thelight receiving section 120. On the other hand, thestereoscopic-shape-data acquiring section 212 generates a second heightimage of the measurement object WK on the basis of the second lightreception data received by the light receiving section 120.

Depth Measurement Range

In a stage plane on which an imaging visual field of the light receivingsection 120 is located on the stage 140, a common height range in whichthe first pattern light and the second pattern light can be respectivelyirradiated from the first light projecting section 110A and the secondlight projecting section 110B is set as a depth measurement range. Thesynthesis processing section 216 combines the first height image and thesecond height image having stereoscopic shape data in the depthmeasurement range and generates a synthesized height image.

Depth Search Range

On the other hand, in the stage plane of the light receiving section 120on the stage 140, a height range including a region in which the firstpattern light or the second pattern light can be irradiated only fromone of the first light projecting section 110A and the second lightprojecting section 110B is set as a depth search range. Thedetermination processing section 214 can set, as a determinationcondition, a condition that a surface region of the measurement objectWK is present in the depth search range.

Measurement Light Source 111

The measurement light source 111 of each of the first light projectingsection 110A and the second light projecting section 110B is, forexample, a halogen lamp that emits white light. The measurement lightsource 111 may be another light source such as a white LED (lightemitting diode) that emits white light. Light emitted from themeasurement light source 111 (hereinafter referred to as “measurementlight”) is appropriately condensed by the lens 113 and thereafter madeincident on the pattern generating section 112.

The pattern generating section 112 is, for example, a DMD (digitalmicromirror device). The pattern generating section 112 may be an LCD(liquid crystal display), an LCOS (liquid crystal on silicon: reflectiveliquid crystal device), or a mask. The measurement light made incidenton the pattern generating section 112 is converted into a pattern set inadvance and intensity (brightness) set in advance and emitted. Themeasurement light emitted by the pattern generating section 112 isconverted into light having a diameter larger than an observable andmeasurable visual field of the light receiving section 120 by theplurality of lenses 114 and 115 and thereafter irradiated on themeasurement object WK on the stage 140.

Disposition shown in FIG. 4 is an example. The disposition of theoptical system members can be changed as appropriate. For example, thepattern generating section 112 may be disposed on an emission surfaceside of the lens 115.

Light Receiving Section 120

The light receiving section 120 is disposed above the stage 140. Themeasurement light reflected to above the stage 140 by the measurementobject WK is condensed and focused by the plurality of lenses 122 and123 of the light receiving section 120 and thereafter received by thecamera 121.

Camera 121

The camera 121 is, for example, a CCD (charge coupled device) cameraincluding an imaging element 121 a and a lens. The imaging element 121 ais, for example, a monochrome CCD (charge coupled device). The imagingelement 121 a may be another imaging element such as a CMOS(complementary metal oxide semiconductor) image sensor. In a colorimaging element, pixels need to be associated with received lights forred, green, and blue. Therefore, measurement resolution is low comparedwith a monochrome imaging element. Since color filters need to beprovided in the pixels, sensitivity decreases. Therefore, in thisembodiment, the monochrome CCD is adopted as the imaging element. Acolor image is acquired by irradiating, in a time division manner,lights respectively corresponding to R, G, and B from theillumination-light output section 130 to perform imaging. With such aconfiguration, it is possible to acquire a color image of a measurementobject without deteriorating measurement accuracy.

However, it goes without saying that the color imaging element may beused. In this case, although the measurement accuracy and thesensitivity are deteriorated, it is unnecessary to irradiate, in a timedivision manner, the lights respectively corresponding to R, G, and Bfrom the illumination-light output section 130. A color image can beacquired by simply irradiating the white light. Therefore, theillumination optical system can be simply configured. Analog electricsignals corresponding to a light reception amount (hereinafter referredto as “light reception signals”) are output from the pixels of theimaging element 121 a to the measurement control section 150.

Measurement Control Section 150

An A/D converter (analog/digital converter) and an FIFO (first in firstout) memory are mounted on the measurement control section 150. A lightreception signal output from the camera 121 is sampled at apredetermined sampling cycle by the A/D converter of the measurementcontrol section 150 and converted into a digital signal on the basis ofcontrol by the light source section 300. Digital signals output from theA/D converter are sequentially accumulated in the FIFO memory. Thedigital signals accumulated in the FIFO memory are sequentiallytransferred to the control section 200 as pixel data.

Control Section 200

As shown in FIG. 1, the control section 200 includes a CPU (centralprocessing unit) 210, a ROM (read only memory) 220, a work memory 230, astoring section 240, and a setting section 250. As the control section200, a computer such as a PC (personal computer) or a work station canbe used. A dedicated controller may be prepared. Alternatively, thecontrol section 200 may be constructed by combining a general-purposecomputer and the dedicated controller. In this example, the controlsection 200 is configured by a computer installed with a shape measuringprogram.

The setting section 250 is operated by the operation device 450. Theoperation device 450 includes a keyboard and a pointing device. As thepointing device, a mouse, a joystick, or the like is used. The operationdevice 450 can be integrated with the display section 400. For example,by using a touch panel in the display section 400, it is possible toimpart a function of an operation section to the display section 400.

A system program is stored in the ROM 220. The work memory includes aRAM (random access memory) and used for processing of various data. Thestoring section 240 includes a hard disk. An image processing programand a shape measuring program are stored in the storing section 240. Thestoring section 240 is used for saving various data such as pixel datagiven from the measurement control section 150.

The CPU 210 generates image data on the basis of the pixel data givenfrom the measurement control section 150. The CPU 210 performs variouskinds of processing on the generated image data using the work memory230 and causes the display section 400 to display an image based on theimage data. Further, the CPU 210 gives a driving pulse to a stagedriving section 145 explained below. Further, the CPU 210 realizesfunctions of the stereoscopic-shape-data generating section 212, thedetermination processing section 214, the synthesis processing section216, the three-dimensional-image synthesizing section 213, and thedepth-expansion processing section 215.

Display Section 400

The display section 400 is a member for displaying a measurement imageacquired by the imaging section 100 and a captured observation image.The display section 400 is configured by, for example, an LCD panel oran organic EL (electroluminescence) panel.

Stage 140

The stage 140 is a member for placing the measurement object WK on theupper surface thereof. The stage 140 includes, as shown in FIG. 1, astage operation section 144 for the user to manually move the stage 140and the stage driving section 145 for electrically moving the stage 140.

In FIG. 4, two directions orthogonal to each other in a plane on thestage 140 on which the measurement object WK is placed (hereinafterreferred to as “placement surface”) are defined as an X direction and aY direction and respectively indicated by arrows X and Y. A directionorthogonal to the placement surface of the stage 140 is defined as a Zdirection and indicated by an arrow Z. A direction of rotation around anaxis parallel to the Z direction is defined as a θ direction andindicated by an arrow θ. A rotation axis of a θ stage does not need tobe parallel to an optical axis parallel to the Z direction and may be,for example, inclined 45° with respect to the optical axis.

The stage 140 include an XY stage 141, a Z stage 142, and a θ stage 143.The XY stage 141 includes an X-direction moving mechanism and aY-direction moving mechanism as a stage-plane-direction driving section.The Z stage 142 includes a Z-direction moving mechanism. The θ stage 143includes a θ-direction rotating mechanism. The stage 140 is configuredby the XY stage 141, the Z stage 142, and the θ stage 143. The stage 140further includes a fixing member (a clamp) that fixes the measurementobject WK to the placement surface. The stage 140 may further include atilt stage including a mechanism capable of rotating around an axisparallel to the placement surface.

Stepping motors are respectively used in the X-direction movingmechanism, the Y-direction moving mechanism, the Z-direction movingmechanism, and the θ-direction rotating mechanism of the stage 140. TheX-direction moving mechanism, the Y-direction moving mechanism, theZ-direction moving mechanism, and the θ-direction rotating mechanism ofthe stage 140 are driven by the stage operation section 144 or the stagedriving section 145 shown in FIG. 1.

The user can relatively move the placement surface of the stage 140 inthe X direction, the Y direction, or the Z direction with respect to thelight receiving section 120 or rotate the placement surface of the stage140 in the θ direction by manually operating the stage operation section144. The stage driving section 145 can relatively move the stage 140 inthe X direction, the Y direction, or the Z direction with respect to thelight receiving section 120 or rotate the stage 140 in the θ directionby supplying an electric current to the stepping motors of the stage 140on the basis of a driving pulse given from the control section 200.

As shown in FIG. 4, a relative positional relation among the lightreceiving section 120, the light projecting section 110, and the stage140 is decided such that the center axes of the left and right lightprojecting sections 110 and the center axis of the light receivingsection 120 cross one another on a focus plane on which the stage 140comes into focus most. The center of a rotation axis in the θ directioncoincides with the center axis of the light receiving section 120.Therefore, when the stage 140 is rotated in the θ direction, themeasurement object WK does not move out of a visual field and rotates inthe visual field around the rotation axis. The X, Y, and θ and tiltmoving mechanisms are supported with respect to the Z-direction movingmechanism. That is, even in a state in which the stage 140 is rotated inthe θ direction or tilted, deviation does not occur between the centeraxis of the light receiving section 120 and the moving axis in the Zdirection. With such a stage mechanism, even in a state in which theposition and the posture of the measurement object WK are changed, it ispossible to move the stage 140 in the Z direction and capture aplurality of images in different focal positions and combine the images.In this embodiment, the electric stage that can be driven by thestepping motors is explained as the example. However, the stage 140 maybe a manual stage that can be only manually moved.

Light Source Section 300

The light source section 300 includes a control board 310 and anillumination light source for observation 320. A CPU is mounted on thecontrol board 310. The CPU of the control board 310 controls the lightprojecting section 110, the light receiving section 120, the measurementcontrol section 150 on the basis of a command from the CPU 210 of thecontrol section 200. This configuration is an example. Otherconfigurations may be adopted. For example, the light projecting section110 and the light receiving section 120 may be controlled by themeasurement control section 150 or the light projecting section 110 andthe light receiving section 120 may be controlled by the control section200 and the control board may be omitted. Alternatively, a power circuitfor driving the imaging section 100 may be provided in the light sourcesection 300.

Illumination Light Source for Observation 320

The illumination light source for observation 320 includes, for example,LEDs of three colors that emit red light, green light, and blue light.Light of any color can be generated from the illumination light sourcefor observation 320 by controlling illuminance of the lights emittedfrom the LEDs. The light generated from the illumination light sourcefor observation 320 (hereinafter referred to as “illumination light”) isoutput from the illumination-light output section 130 of the imagingsection 100 through a light guide member (a light guide).

The illumination light output from the illumination-light output section130 is irradiated on the measurement object WK while being switched tothe red light, the green light, and the blue light in a time divisionmanner. Consequently, it is possible to combine observation imagesrespectively captured by the R, G, and B lights, obtain a colorobservation image, and cause the display section 400 to display thecolor observation image.

When the color observation image is displayed in this way, if aswitching frequency for switching the color of the illumination light ismatched with a frame rate at the time when display content is updated (ascreen is rewritten) on the display section 400, flickering becomesconspicuous when the frame rate is low (e.g., approximately severalhertz). In particular, if color switching by the primary colors of R, G,and B is conspicuous, an unpleasant feeling is sometimes given to theuser. Therefore, such a problem can be avoided by setting the switchingfrequency for switching the illumination lights of R, G, and B to a highfrequency (e.g., several hundred hertz) that the user cannot recognize.The switching of the colors of the illumination light is performed bythe illumination-light output section 130 or the like. Although R, G,and B of the illumination light is switched at high speed, timing foractually imaging the measurement object WK with the imaging section 100is set to timing of the update of the display content on the displaysection 400. That is, it is unnecessary to completely match the timingof the imaging of the observation image and the timing of the switchingof the illumination light. The timings can be matched by being linked toa degree for enabling imaging of the observation images of R, G, and Bby the imaging element, in other words, such that a switching cycle ofR, G, and B of the illumination light is a multiple of an imaging cycle.With this method, it is possible to accelerate the timing of theswitching of the illumination light. It is possible to reduce theunpleasant feeling given to the user without improving a frame rate thatcan be processed by the imaging element 121 a.

In the example shown in FIG. 1, the illumination light source forobservation 320 is externally attached to the imaging section 100. Theillumination light source for observation 320 is disposed in the lightsource section 300. Consequently, it is possible to avoid a situation inwhich heat generation of the illumination light source for observation320 affects the optical system of the imaging section 100. However, itis also possible to provide an illumination light source for observationon the imaging section side by, for example, using an illumination lightsource for observation with a small heat value or providing anappropriate heat radiating mechanism on the imaging section side. Inthis case, it is possible to integrate the illumination-light outputsection and the illumination light source for observation, for example,incorporate the illumination light source for observation in theillumination-light output section. It is possible to make it unnecessaryto provide the light guide member for optically connecting the lightsource section and the imaging section. It is possible to simplify aconfiguration. Similarly, concerning the light projecting section, thelight source for projection can be incorporated in the imaging sectionor can be externally attached to the light source section side.

The illumination-light output section 130 shown in FIG. 4 has a ringshape and is disposed above the stage 140 to surround the lightreceiving section 120. Consequently, illumination light is irradiated onthe measurement object WK from the illumination-light output section 130not to form a shadow. Besides being ring-shaped ring illumination, theillumination-light output section 130 can be coaxial epi-illumination,side spot illumination, transmission illumination, or the like or can bea combination of these kinds of illumination. The illumination-lightoutput section may be omitted by irradiating uniform light from thelight projecting section 110 as the illumination light. For example, thelight projecting section 110 can be used as the illumination-lightoutput section as well by enabling white pattern image projection usinga two-dimensional array. In this way, when the white pattern imageprojection of the two-dimensional array of the light projecting section110 is used as the illumination light source for observation, a pixelgrid of the two-dimensional array may be prevented from being reflectedon the measurement object WK by projecting light, which is transmittedthrough or reflected on the two-dimensional array, on the measurementobject WK through a diffusion plate.

Example of a GUI

An operation program for operating the shape measuring device 500 isinstalled in a PC, which is the control section 200. A GUI (graphicaluser interface) for operating the shape measuring program is displayedon the display section 400. An example of such a GUI screen is shown inFIG. 5. In this example, a first measurement image S1 of the measurementobject WK on which first measurement light is irradiated from the firstlight projecting section 110A and a second measurement image S2 of themeasurement object WK on which second measurement light is irradiatedfrom the second light projecting section 110B are displayed side by sideon the display section 400. In this example, a first display region 416is provided on the right side and a second display region 417 isprovided on the left side of an image display region 410 provided on theleft side of the display section 400. By adopting such two-screendisplay, it is possible to confirm states of measurement images obtainedby the measurement lights, in particular, regions or the like formingshadows while comparing the states and the regions or the like. Adivision example of the image display regions is not limited to theconfiguration in which the image display regions are disposed side byside on the left and the right. Any configuration can be used asappropriate in which, for example, the image display regions arevertically disposed or the image display regions are configured asseparate screens.

An image switching section capable of switching a displayed image to anobservation image and a measurement image is provided in the operationprogram of the shape measuring device. In this example, when an“observation image” button 427 is pressed as the image switchingsection, an observation image captured using the illumination lightsource for observation is displayed in the image display region 410.When a “measurement image” button 428 is pressed, a measurement imageacquired using a measurement-light projecting section is displayed inthe image display region 410. The user can change the brightness of themeasurement lights emitted from the first light projecting section 110Aand the second light projecting section 110B or camera exposure timescorresponding to the first light projecting section 110A and the secondlight projecting section 110B by operating, with the operation device450 of the control section 200 shown in FIG. 1, an operation region 420provided in the GUI and performing, for example, brightness adjustment.Parameters for changing the brightness of the illumination lights arethe camera exposure times. Imaging conditions of the observation imageare set according to necessity. An observation-image-capturing-conditionsetting section 490 for setting such imaging conditions of theobservation image is provided in an upper part of the image displayregion 410 shown in FIG. 5. The observation-image-capturing-conditionsetting section 490 includes setting of, for example, shutter speedswitching for capturing the observation image, magnification of theimaging, and focus adjustment. In the example shown in FIG. 5, thebrightness of the imaging section is selected from “auto” and “manual”.When the “manual” is selected, the brightness of the imaging section isadjusted by a camera brightness adjustment slider.

As explained above, in the image display region 410, images of themeasurement object WK in the case in which the measurement lights arerespectively irradiated by the first light projecting section 110A andthe second light projecting section 110B are displayed side by side.Therefore, the user can appropriately adjust the brightness of themeasurement lights respectively emitted from the first light projectingsection 110A and the second light projecting section 110B or the cameraexposure times corresponding to the respective light projecting sections110 by respectively moving the positions of brightness adjustmentsliders 444 and 446 while viewing the images of the measurement objectWK displayed in the image display region 410.

A correlation is sometimes present between appropriate brightness of themeasurement lights emitted from the first light projecting section 110Aand the second light projecting section 110B and appropriate brightnessof the illumination light emitted from the illumination-light outputsection 130 or camera exposure times corresponding to the respectivelight projecting sections 110. In this case, the brightness of themeasurement lights respectively emitted from the first light projectingsection 110A and the second light projecting section 110B or the cameraexposure times corresponding to the respective light projecting sections110 may be automatically adjusted on the basis of the brightness of theillumination light emitted from the illumination-light output section130 or the camera exposure time corresponding to the illumination light.

Alternatively, an adjustment guide for appropriately adjusting thebrightness of the measurement lights respectively emitted from the firstlight projecting section 110A and the second light projecting section110B or the camera exposure times corresponding to the respective lightprojecting sections 110 on the basis of the brightness of theillumination light emitted from the illumination-light output section130 or the camera exposure time corresponding to the illumination lightmay be displayed on the display section 400. In this case, the user canappropriately adjust the brightness of the measurement lightsrespectively emitted from the first light projecting section 110A andthe second light projecting section 110B or the camera exposure timescorresponding to the respective light projecting sections 110 byrespectively moving the positions of the brightness adjustment sliders444 and 446 on the basis of the adjustment guide.

If an irradiating direction of light is different, a reflectingdirection of the light is also different. Therefore, the brightness ofan image obtained as a result is different depending on the irradiatingdirection of the light even in the same part. That is, the brightness ofmeasurement light suitable for measurement and an exposure time of theimaging element are different depending on the irradiating direction. Inthis embodiment, it is possible to set appropriate brightness of themeasurement lights or appropriate exposure times for each of irradiatingdirections by making it possible to individually adjust the brightnessof respective images captured by irradiating lights from the pluralityof first and second light projecting sections 110A and 110B. An image,the brightness of which is being adjusted, is displayed while beingupdated in the image display region 410. Therefore, it is possible toadjust the brightness while confirming the image after the adjustment.In this case, it is also possible to more clearly indicate whether thebrightness can be appropriately adjusted for the user by distinguishablydisplaying a portion of white void due to excessive brightness and aportion of black solid due to excessive darkness in the image displayedin the image display region 410.

Telecentric Both Side Light Projecting Optical System

A schematic diagram of a telecentric both side light projecting opticalsystem is shown in FIG. 6. As shown in FIG. 6, a right light projectingoptical system configured by the first light projecting section 110A anda left light projecting optical system configured by the second lightprojecting section 110B are respectively disposed as light projectingoptical systems configuring the light projecting section 110 thatprojects light on the measurement object WK placed on the stage 140. Byproviding the light projecting optical systems respectively on the leftand the right, there are advantages such as a reduction of a regionwhere pattern light forms a shadow to disable measurement.

On the other hand, a light receiving optical system configuring thelight receiving section 120 includes an imaging element for lowmagnification 120A and an imaging element for high magnification 120B. Abifurcation both side telecentric light receiving lens 125 is providedabove a prism 124 in the center. The imaging element for highmagnification 120B is disposed on the right side of the prism 124. Asshown in FIG. 6, the light projecting optical system irradiates lightmore widely than a visual field.

The light receiving optical system is configured by a light receivinglens and a camera unit. With priority given to accuracy, the lightreceiving lens is a telecentric optical system having fixedmagnification. However, the light receiving lens may be a zoom lens andcover wide magnification. The shape measuring device adopts abifurcation fixed focus both side telecentric optical system. The shapemeasuring device includes two cameras, that is, a camera for lowmagnification and a camera for high magnification. Consequently, it ispossible to change magnification through electric switching rather thanmechanical switching for a zoom lens. It is possible to realize stablemeasurement performance without occurrence of measurement accuracydeviation or the like due to mechanical positioning accuracy.

A measurement range by left and right both side light projection isexplained with reference to a schematic diagram of FIG. 7. The shapemeasuring device is configured to be capable of projecting pattern lightin directions symmetrical across the light receiving lens in order tominimize a shadow region (an unmeasurable region). Pattern lightprojecting optical systems are respectively disposed on the left and theright.

As the light receiving lens, the bifurcation both side telecentric lightreceiving lens 125 is adopted. It is possible to acquire an imagewithout a magnification change due to the height of the measurementobject WK and without distortion when viewed from right above. Whencombined with the configuration of the both side telecentric lightprojecting lens, an effect of simplifying measurement setting, that is,fixing a light projecting and receiving angle anywhere in a visual fieldis exerted. As shown in FIG. 7, the bifurcation both side telecentriclight receiving lens 125 has a visual field where two magnifications arecoaxial. There is an advantage that visual field adjustment can be madeunnecessary even if magnification is switched.

Two-dimensional pattern lights are irradiated on the measurement objectWK from the left and right light projecting lenses 116 as parallel lightbeams at equal light projecting angles on the left and the right.Examples of an advantage of symmetrically irradiating thetwo-dimensional pattern lights across the light receiving lens from theleft and the right include not only the effect of minimizing a shadowexplained above but also an effect that, for example, it is possible toreduce errors, which respectively occur on the left and the right, bycombining respective measurement results on the left and the right(e.g., average processing).

As shown in the schematic diagram of FIG. 7, in a relation between leftand right light projection and a measurement range, the breadth of ameasurement visual field (in the XY direction) is determined by thewidth of the light beam of the light receiving lens (the width of a beamindicated by a thin line (low magnification) or a thick line (highmagnification) in FIG. 7). A range of height measurement using one setof pattern projections is determined from relationship between lightprojection and light reception. Like a region of a dotted line frame inFIG. 7, a depth measurement range is defined as a common region of areceived light beam and projected light beams from the left and theright. That is, the common region of the left and right projected lightirradiations indicated by the dotted line frames indicates a range ofmeasurable height. By determining the depth measurement range in thisway, irradiation of lights from the left and the right is uniformirrespective of where the irradiation of the lights is measured in thedepth measurement range. An effect of stabilizing measurement byaveraging measurements on the left and the right can be realized in theentire region of the depth measurement range.

XY Stage 141

The XY stage 141 includes an inclination sensor and the stage drivingsection 145 (a microcomputer, an FPGA, and a motor driver) on theinside. The XY stage 141 is electrically connected to the stage drivingsection 145 on the inside of the base housing 149 through the stagesupporting section 152. The electric connection of the stage supportingsection 152 and the XY stage 141 is configured by a connector.Consequently, the XY stage 141 is configured to be detachablyattachable. The XY stage 141 can be changed to a different visual fieldadjustment stage such as a tilt/rotation stage.

Flow of Measurement by the Fringe Projection Method

An overview of a flow of operation for measuring a shape is explainedwith reference to FIG. 4. It is assumed that the entire followingexplanation is explanation in “one-shot measurement” in which the Zstage 142 is fixed in the height direction.

First, the user places the measurement object WK, which the user desiresto measure, on the stage 140 and adjusts, with an illumination-conditionadjusting section, a focus, a visual field position, brightness, and thelike while viewing an optical image projected on the display section400. Ring illumination is used as the illumination-light output section130. However, the illumination-light output section 130 is not limitedto the ring illumination. For example, uniform illumination light may beirradiated from the light projecting section 110 configuring alight-projecting-system illumination section.

Subsequently, the user switches the illumination light from the ringillumination to the light projecting section 110 and adjusts thebrightness of light projecting system illumination light. Since theillumination light by the light projecting section 110 is obliquelyirradiated, a shadow due to the shape of the measurement object WK isformed. Depending on a surface state of the measurement object WK, themeasurement object WK is seen better when the illumination light isinclined more or less. To incline the illumination light, for example, atilt stage capable of inclining the stage 140 is used or an incliningmechanism is provided in the light projecting section 110. To preventthe influence of the shadow of the illumination light and the surfacestate, the user readjusts the position and the posture of themeasurement object WK according to necessity.

In such an adjusting process in the light projecting section 110, whenthe measurement object WK is moved, the user switches the illuminationlight to the ring illumination again and performs, for example,confirmation of how the measurement object WK is seen in the ringillumination light and readjustment of the brightness of the ringillumination light. This work can be omitted if unnecessary.

When the posture, the position, the focus, and an illumination conditionfor measurement of the measurement object WK are decided, the controlsection 200 transmits a command for a measurement start to themeasurement control section 150. The control section 200 is configuredby the computer installed with the shape measuring program as explainedabove. Receiving the command, the measurement control section 150synchronously controls a pattern generating unit in the light projectingsection 110 and the imaging section 100, acquires, with the imagingsection 100, a plurality of images of the measurement object WK whileprojecting a plurality of patterns, applies appropriate processing tothe control board 310, and thereafter transmits image data to thecontrol section 200.

Generation of a Height Image

The image data received by the control section 200 is appropriatelyprocessed and analyzed by a measurement algorithm in the shape measuringprogram. Stereoscopic shape data is generated. Specifically, a heightimage having height information is generated by the height-imagegenerating section 212 b.

Generation of a Texture Image

On the other hand, the imaging section 100 irradiates illumination lighton the measurement object WK and acquires a texture image, which is animage showing a surface state of the measurement object WK. For example,the imaging section 100 irradiates ring illumination on the measurementobject WK or irradiates, from the light projecting section 110, a lightprojection pattern (totally white) with all pixels turned on to capturean optical image with uniform illumination light and form a textureimage.

The texture image is not limited to one. A plurality of texture imagesmay be captured. In this case, the plurality of texture images can becombined to generate an HDR (high dynamic range) image or a depthsynthesis image. The HDR image is an image generated by capturing aplurality of texture images while changing an exposure time of a cameraand thereafter performing high-dynamic range (HDR) combination of thetexture images. When a level difference of a measurement target portionof the measurement object WK exceeds a depth of field, the depthsynthesis image is an image synthesized by extracting only a focusedportion out of observation images individually captured by varying aheight direction.

Generation of a Synthesized Image

The obtained texture image is also transferred to the control section200. The control section 200 combines the texture image and the heightimage to generate a synthesized image. For example, the control section200 maps, with the shape measuring program, the texture image to theheight image, which is the stereoscopic shape data, and generatessynthesized image data with the three-dimensional-image synthesizingsection. The synthesized image is displayed on the display section 400.In this state, desired measurement and analysis can be performed on thesynthesized image.

Shape Measuring Method

A procedure for generating the synthesized image explained above andperforming shape measurement is explained with reference to a flowchartof FIG. 9. First, in step S901, the user places the measurement objectWK on the stage 140.

Subsequently, in step S902, the user adjusts the position, the posture,the focus, and the brightness of the measurement object WK using ringillumination.

In step S903, the user switches the ring illumination to the lightprojecting system and adjusts the brightness of the light projectingsystem illumination and the position and the posture of the measurementobject WK.

In step S904, the user switches the light projecting system to the ringillumination, further switches the ring illumination to the lightprojecting system, and confirms how the measurement object WK is seen.

In step S905, the user confirms whether there is no problem in how themeasurement object WK is seen. If there is a problem, the user returnsto step S902 and repeats the processing explained above. On the otherhand, if there is no problem, the user proceeds to step S906 and pressesa measurement start button.

In step S907, the control section 200 projects stripe patterns from thelight projecting section, scans the stripe patterns, and acquires aplurality of stripe images of the measurement object WK with a camera insynchronization with the scanning. The control section 200 may repeatthis step a specified number of times for improvement of the left andright light projection, the HDR, and other performance. It is possibleto reduce the influence of halation by, for example, changing anexposure time and projecting pattern light a plurality of times.

In step S908, the control section 200 lights the ring illumination andacquires a texture image of the measurement object WK.

In step S909, the control section 200 processes a stripe image set witha measurement algorithm and generates stereoscopic shape data.

In step S910, the control section 200 maps the texture image to thestereoscopic shape data.

In step S911, the control section 200 causes the display section 400 todisplay a result. In step S912, the control section 200 determineswhether data of a target part is successfully correctly acquired. Whenthe data is not successfully correctly acquired, the control section 200returns to step S903 and repeats the processing explained above. On theother hand, when the data is successfully correctly acquired, thecontrol section 200 proceeds to step S913 and executes various kinds ofmeasurement and analyses using measurement software and the like.

As explained above, it is possible to generate the synthesized imageusing the shape measuring device and perform the shape measurement. Theorder of step S901 and S902 in FIG. 9 may be changed. In that case,first, in the measurement setting (step S902), the user performsalignment of the posture, the position, and the focus of the measurementobject WK. In the texture image acquisition (step S901), the user doesnot change the posture, the position, and the focus of the measurementobject WK and performs only, for example, selection of the brightness ofthe ring illumination and a texture type.

Procedure for Acquiring a Texture Image

A procedure for acquiring a texture image is explained with reference toa flowchart of FIG. 10. The procedure is equivalent to detailedexplanation of the process in step S902 of FIG. 9. First, in step S1001,the user switches the light projecting system to the ring illumination.

Subsequently, in step S1002, the user adjusts the brightness of the ringillumination. In step S1003, the user determines whether the brightnessis appropriate. When the brightness is inappropriate, the user returnsto step S1002 and repeats the processing. On the other hand, when thebrightness is appropriate, the user proceeds to step S1004, moves the Zstage 142, and aligns a focus position of the measurement object WK.Further, in step S1005, the user determines whether the focus positionis correct. When the focus position is incorrect, the user returns tostep S1004 and repeats the processing. On the other hand, when the focusposition is correct, the user proceeds to step S1006, moves the XY, 0,and tilt stages and aligns the position and the posture of themeasurement object WK. The order of the steps S1002 to S1006 may bechanged as appropriate.

In step S1007, the user determines whether a part that the user desiresto view fits within a visual field. When the part does not fit withinthe visual field, the user returns to step S1006 and repeats theprocessing. On the other hand, when the part fits within the visualfield, in step S1008, the user changes magnification and adjusts size.

In step S1009, the user determines whether the magnification isappropriate. When the magnification is inappropriate, the user returnsto step S1008 and repeats the processing. On the other hand, when themagnification is appropriate, the user proceeds to step S1010 anddetermines whether to select a type of a texture image. When notselecting a type of a texture image, the user proceeds to step S1011 andselects a normal image and ends this processing.

On the other hand, when selecting the type of the texture image, theuser proceeds to step S1012, determines whether to perform depthsynthesis. When performing the depth synthesis, the user proceeds tostep S1013 and executes setting of the depth synthesis. On the otherhand, when not performing the depth synthesis, the user directly jumpsto step S1014.

In step S1014, the user determines whether to perform HDR. Whenperforming the HDR, the user proceeds to step S1015 and executes settingof the HDR. On the other hand, when not performing the HDR, the userdirectly jumps to step S1016.

In step S1016, the user determines whether to perform confirmation ofthe texture image. When performing the confirmation of the textureimage, the user proceeds to step S1017 and causes the display section400 to display a preview of the texture image. On the other hand, whennot performing the confirmation of the texture image, the user ends thisprocessing.

In step S1018, the user determines whether the user is satisfied with aresult of the texture image, the preview of which is displayed. When notsatisfied with the result, the user returns to step S1012 and repeatsthe processing. On the other hand, when satisfied with the result, theuser ends this processing. As explained above, it is possible to acquirethe texture image.

Procedure for Performing Setting of Measurement Setting

Measurement setting for generating stereoscopic shape data includeslight projection setting of pattern light of the light projectingsection, light reception setting and an imaging condition of the lightreceiving section, and an illumination condition of the illuminatingsection. These kinds of measurement setting are set by the measurementsetting section 255 shown in FIG. 1 and the like. A procedure forperforming the setting of the measurement setting is explained withreference to a flowchart of FIG. 11. The procedure is equivalent todetailed explanation of the process of step S903 in FIG. 9.

First, in step S1101, the user switches the ring illumination to a lightprojecting system for measurement (in FIG. 4, a left-side lightprojecting system). Subsequently, in step S1102, the user provisionallyadjusts the brightness.

In step S1103, the user determines whether illumination is irradiated ona measurement part. When the illumination is not irradiated on themeasurement part, in step S1104, the user moves the θ and tilt stagesand adjusts the position and the posture of the measurement object WK.On the other hand, when the illumination is irradiated on themeasurement part, the user directly jumps to step S1106.

In step S1105, the user determines whether the illumination isirradiated. When the illumination is not irradiated, the user returns tostep S1104 and repeats the processing. On the other hand, when theillumination is irradiated, in step S1106, the user determines whetherthe brightness of the measurement part is appropriate. When thebrightness of the measurement part is inappropriate, in step S1107, theuser adjusts the brightness. On the other hand, when the brightness ofthe measurement part is appropriate, the user directly jumps to stepS1109.

In step S1108, the user determines whether the brightness is correct.When the brightness is incorrect, the user returns to step S1107 andrepeats the processing. On the other hand, when the brightness iscorrect, in step S1109, the user determines whether the measurement partis in focus. When the measurement part is not in focus, in step S1110,the user moves the stage 140 and focuses on the measurement part. On theother hand, when the measurement part is in focus, the user jumps tostep S1112.

In step S1111, the user determines whether the measurement part is infocus. When the measurement part is not in focus, the user returns tostep S1110 and repeats the processing. On the other hand, when themeasurement part is in focus, the user proceeds to step S1112 andperforms general determination. The user determines whether thebrightness, the posture, and the focus of the measurement part areappropriate. When the brightness, the posture, and the focus of themeasurement part are inappropriate, in step S1113, the user confirms aninappropriate parameter and returns to an appropriate procedure. Theuser returns to any one of step S1104, step S1107, and step S1110according to the inappropriate parameter.

On the other hand, when it is determined in the general determinationthat the brightness, the posture, and the focus of the measurement partare appropriate, the user proceeds to step S1114 and switches theillumination light to a light projecting system for measurement (in FIG.4, a right-side light projecting system). In step S1115, the useradjusts the brightness. In step S1116, the user determines whether thebrightness is correct. When the brightness is incorrect, the userreturns to step S1115 and repeats the processing. On the other hand,when the brightness is correct, the user ends this processing.

The order of the position adjustment, the posture adjustment, the focusadjustment, and the brightness adjustment can be changed as appropriatein these procedures.

In this way, the measurement setting can be set. Besides beingautomatically performed by the user from the measurement setting section255, the measurement setting can also be automatically performed on theshape measuring device side.

Measurement Range Expanding Function in the Depth Direction

In this embodiment, the pattern projection method based on thetriangulation system is adopted as a noncontact measurement system. Inthis system, it is possible to expand a depth measurement range, whichcan be realized by one time of measurement, by a distance of movementby, on the basis of the triangulation system having a wide depthmeasurement range in one time of measurement, physically or opticallymoving the position of the measurement object or the shape measuringdevice, repeating the measurement, and combining measurement results. Asa result, it is possible to quickly measure a wider range than thetriangulation system. It is possible to realize the shape measuringdevice and the shape measuring method capable of measuring a widervisual field with high resolution. It is possible to expand, inrespective visual fields, a measurement range in the depth direction.

As shown in FIG. 8 and the like, the shape measuring device according tothe first embodiment is capable of measuring a surface shape of themeasurement object in a noncontact manner. It is possible to acquire,with the triangulation system using the fringe projection method, heightinformation in pixels in a light receiving optical system visual fieldin one time of measurement. The shape measuring device includes thestage 140 capable of relatively moving with respect to the measuringsection. A stage height reading axis and an observation optical axishave a common axis.

The shape measuring device includes, on the inside of one upper head101, the bifurcation light receiving optical system capable ofperforming observation at two magnifications. Consequently, it ispossible to perform measurement while switching magnification in acoaxial visual field. Two magnifications of low magnification and highmagnification have the same optical axis. The shape measuring device hasa pattern light projection optical axis inclined in symmetricaldirections centering on an intersection of the optical axis and a bestfocus surface (a focus surface) of the light receiving optical system.The shape measuring device performs pattern projection respectively fromthe pattern light projection optical axis directions, captures aplurality of images with the light receiving optical system, analyzesthe images, and calculates height information.

Measurement Range

In the focus surface and the measurement range of the shape measuringdevice, as shown in FIG. 7, the upper head 101 has a photographingvisual field in a look-down direction from right above to right below.The measurement object on an XYZ stage disposed below the upper head 101is measured from right above. The user disposes the measurement objecton the top surface of the XYZ stage. The user can adjust a visual fieldby moving the XY stage 141 and adjust a focus by moving the Z stage 142.Alternatively, the user can change a relative distance (a workingdistance) between the measurement object and the light receiving opticalsystem and adjust the focus by moving the light receiving optical systemside. The focus means focus of the light receiving optical system. Inthe shape measuring device, as shown in FIG. 7, a depth measurementrange in the height direction has fixed width vertically symmetricalcentering on the focus surface. However, the symmetry is not essential.

In the XYZ stage, the Z stage 142 is disposed in a directionsubstantially coinciding with the light receiving optical axis.Consequently, it is possible to change measurement object height in theoptical axis direction (or a relative positional relation in the opticalaxis direction between the upper head 101 and the measurement object)only by moving the Z stage 142. A scale unit 160 capable of detecting amoving distance of the Z stage 142 is disposed on the inside of the Zstage 142. As shown in FIG. 8 and the like, the scale unit 160 isdisposed right below a visual field of the upper head 101. Since thescale unit 160 is disposed right below the visual field in this way, itis possible to detect a positional relation between the depthmeasurement range and the measurement object with a minimum error. Ingeneral, when the position of a sensor that performs detection, that is,a measurement axis is offset from a measurement position of themeasurement object with respect to a coordinate point where detection isdesired to be performed, a measurement error can occur on the basis ofthe Abbe principle. Such a state occurs when the measurement axis isdisposed in parallel to a position desired to be measured. On the otherhand, according to the Abbe principle, when the measurement axis and themeasurement position of the measurement object are present on anextended line of the same plane, it is possible to reduce such ameasurement error. That is, the position desired to be measured and themeasurement axis are linearly disposed.

Depth Expanding Function

In order to expand the depth measurement range in the height direction,the stage 140 and the light receiving section 120 are relatively movedin the optical axis direction with the optical-axis-direction drivingsection 146. The light receiving section 120 has a predetermined focaldepth. A pattern image can be captured only at height in a fixed range(a depth measurement range) decided by the focal depth. Therefore, it ispossible to expand a measurable depth measurement range by shifting thedepth measurement range with the optical-axis-direction driving section146. That is, by coupling height images generated in the same visualfield (in a stage plane orthogonal to the optical axis direction of thelight receiving section 120) in the height direction for each of pixelsof XY coordinates corresponding to the height images, it is possible toobtain a synthesized height image at height exceeding the restriction ofthe depth measurement range.

In such a depth expanding function, it is necessary to couple the heightimages generated in the same visual field, that is, in the range of theXY plane. Further, it is necessary to couple height images generatedunder the same condition. Specifically, when pattern lights areprojected from the left and right light projecting sections 110 shown inFIG. 7, in the case of height images generated by projecting lights fromboth the sides, the height images of the both side light projection arecoupled to generate a synthesized height image. In height imagesgenerated by one side light projection using one of the light projectingsection 110, similarly, the height images of the one side lightprojection are coupled. In this case, in right side light projection,height images of the right side light projection are coupled. In leftside light projection, height images of the left sidelight projectionare coupled.

In the example shown in FIG. 7 and the like, it is possible to expandthe depth measurement range by executing a plurality of measurementswhile involving the movement of the Z stage and coupling results of themeasurements on the basis of Z-stage heights at which the measurementsare executed. Such one time of measurement with the fixed Z-stage heightis referred to as “one-shot measurement”. Measurement in which resultsof measurement at a plurality of Z-stage heights are coupled is referredto as “depth expansion measurement”.

A concept of the height direction expansion of the depth measurementrange is explained with reference to FIGS. 12A to 12C. FIGS. 12A to 12Cshow, as a frame of a broken line, a depth measurement range defined bya left light projection range and a right light projection range at eachof height A, height B, and height C.

When a measurement object WK2 having structure higher than a depthmeasurement range HIA (a range indicated by a dotted line frame in FIG.12A) of the shape measuring device is measured, it is possible to fitsurfaces of the measurement object WK2 in the depth measurement range bymoving the Z stage 142 in the height direction (changing height to A, B,and C) (thick lines in FIGS. 12A to 12C).

Optical images observed at this time are shown in FIGS. 13A to 13C.Stripe images acquired by the fringe projection method are shown inFIGS. 13D to 13F. In FIGS. 13A to 13C, focused regions are schematicallyindicated by hatching.

In FIGS. 13A and 13D, the lowest surface of the measurement object is infocus at the height A. The shape of the lowest section of themeasurement object can be measured. At the height B to which the Z stage142 is slightly lowered as shown in FIGS. 13B and 13E, a part outsidethe depth measurement range at the height A (a part where blur ofstripes is large on the stripe image; a red dotted light region) is infocus. It is possible to measure the shape of a region fit in fixedwidth centering on this surface. Further, at the height C to which the Zstage 142 is further lowered, a shape (a red dotted line) present at thehighest point of the measurement object is in focus as shown in FIGS.13C and 13F. It is possible to measure the shape of a region fit infixed width centering on this surface.

At the three heights, the height of the Z stage 142 is detected by thescale unit 160. It is possible to acquire a stage height coordinate foreach one shot. The scale unit 160 outputs a scale value indicating arelative distance between the stage 140 and the optical axis directionof the light receiving section 120.

A procedure for coupling measurement results for each one shot obtainedin three times of measurement is explained with reference to schematicdiagrams of FIGS. 14A to 14D. As shown in FIGS. 14A to 14D, measurementdata in a fixed height range (respectively indicated by a dotted lineframe in FIG. 14A, a broken line frame in FIG. 14B, and an alternatelong and short dash line frame in FIG. 14C) is obtained by measurementin each one shot. In this case, a relative movement amount of the stage140 or an absolute stage height of the stage 140 is detected during themeasurement. The measurement data is offset with this detectedcoordinate as a value of a measurement data origin, whereby a relativerelation of shots is defined. Coupled measurement data in which a normalone-shot depth measurement range is expanded is obtained by adding upresults the measurement.

In this way, a scale value at the time when height images are acquiredby the scale unit 160 is stored. When the height images are combined,pixel values of the height images are offset on the basis of the scalevalue and the height images are combined. Specifically, the synthesisprocessing section 216 stores a scale value of the scale unit 160 at thetime when the height images are generated. When combining the heightimages, the synthesis processing section 216 offsets pixel values of theheight images on the basis of the scale value and combines the heightimages.

As explained above, it is possible to perform measurement extended inthe depth direction by repeatedly performing the one-shot measurementcapable of performing measurement in one time of imaging with fringeprojection and coupling the one-shot measurement in the heightdirection. In the coupling of the one-shot depth measurement range, itis not always necessary to make the depth measurement ranges tocontinue. Discrete one-shot measurement separated in the depth directionmay be performed. For example, when the user manually performs depthexpansion, stereoscopic shape data of only a region necessary formeasurement has to be acquired. All information in the depth directionof the measurement object is sometimes unnecessary.

Mask Region

In the automatic expansion in the depth direction, the user can also seta range in which the user desires to perform depth expansion. Forexample, the depth-expansion processing section 215 may include thedepth-range setting section 253 for setting a range for controlling theoptical-axis direction driving section 146 and changing a focal positionof the light receiving section 120. The user may set a mask region withthe depth-range setting section 253 as a range unnecessary in the depthexpansion. In this way, the depth expansion measurement includes notonly continuous coupling of the one-shot measurement but also separatedcoupling.

As explained above, an error of an actual movement amount with respectto a Z-stage movement amount does not have to be considered by detectingthe height of the Z stage 142 simultaneously with the measurement of themeasurement object. If the height detection of the Z stage is notperformed, the origin of the one shots is designated on the basis of amovement pulse (a movement instruction amount) of the Z stage. However,a stage movement error itself is a coupled measurement error. Inaddition, depending on the configuration of the shape measuring device,an error based on the Abbe principle can also occur because of deviationbetween the movement driving axis and an actual measurement objectloading position. On the other hand, the error is reduced and highlyaccurate height detection is realized by detecting the height of the Zstage and bringing a measurement axis for detecting the height of thestage 140 close to the optical axis. Consequently, it is also possibleto improve accuracy in combination in the height direction.

When the stage 140 is expanded in the depth direction to performmeasurement, it is requested to accurately detect movement amounts ofphysical or optical movement of the positions of the measurement objectand the light receiving section 120. In the accurate detection of themovement amounts, based on the Abbe principle, a photographing visualfield of the measuring instrument and a detection position of linearmovement desirably coincide with each other. On the other hand, whenmovement of the stage at a long stroke is detected, a mechanism for thedetection also tends to be long. Therefore, when a sensor is disposedright below the stage, a longer sensor unit is disposed according to themovement stroke. The entire length of a housing has to be increased.

Further, in general, a linear moving mechanism itself requires longstructure compared with a sensor moving section. This is because thewidth of a base housing is added to a movement amount in order toimprove the rigidity of a moving stage. A dimension increase due tooverhang of a guide is also unavoidable. As a result, the height of theentire stage increases. Disadvantages increase, for example, the topsurface of the stage is higher than a setting bottom surface todeteriorate convenience of the user and the amplitude of the measurementobject due to vibration tends to increase. In view of suchcircumstances, in this embodiment, the scale unit 160 that detects theheight of the stage 140 is disposed right below the visual field toimprove disposition flexibility of a stage driving axis.

In an example shown in FIGS. 14A to 14D, the measurement object WK2 hasa relatively simple step. Depending on a measurement object, the entireheight direction of the measurement object can be fit in a measurementregion at two stages of Z-stage heights (e.g., the height A in FIG. 13Aand the height B in FIG. 13B). Synthesis of height information common ina plurality of one-shot data at respective heights is explained.

Synthesis Logic of Common Height Information

As a synthesis method for common height information, there is a methodof calculating a weighted average or a method of adopting one ofreliabilities of height information. When the respective kinds of heightinformation indicate substantially the same height, an error isconsidered to be less in the height information obtained in a positioncloser to a focus surface. Therefore, calculation is performed byweighted average corresponding to the distance from the focus surface.

On the other hand, when the respective kinds of height information aregreatly different, one of the kinds of height information is highlylikely to be noise because of the influence of, for example, multiplereflection of light inside the measurement object. Therefore, in thiscase, reliabilities for determining which of the heights is adopted arecalculated from a blur state of an image, contrast of luminance inpresence or absence of illumination, and the like. The height withhigher reliability is adopted.

Data with Low Reliability

A pixel with high reliability in data included in a height image isdisplayed on the display section 400 or used for measurement. On theother hand, there is a concern that data with low reliability includesan error. Therefore, the data is not displayed on the display section400 and is not used for measurement and the like.

On the other hand, even the data with low reliability can be used todetermine, in depth expansion, whether stereoscopic shape data ispresent. High accuracy is not required to determine whether ameasurement range is expanded in the depth direction to acquire a heightimage if it is possible to determine whether the measurement object iscontinuously present in the height direction. Therefore, in thisembodiment, even data with low reliability not used for usualmeasurement and construction of a height image can be used fordetermination of necessity of the depth expansion.

As an example, concerning a certain measurement object, height imagesgenerated in a depth measurement range up to fixed height underrestriction in specifications of the shape measuring device are shown inFIGS. 15A and 15B. In FIG. 15A, pixels with low reliability in the depthmeasurement range are not displayed. In this way, when the height imageis displayed on the display section 400, in general, pixels with highreliability are displayed and pixels with low reliability are notdisplayed. On the other hand, an example in which the pixels with lowreliability in the height image in FIG. 15A are also displayed is shownin FIG. 15B. In FIG. 15B, pixels on the upper end face of a columnarshape indicated by a region surrounded by a broken line areinappropriate as data used for, for example, dimension measurement ofthe measurement object because accuracy is low. However, it can besurmised that the measurement object is continuously present above theupper end face of the column. Therefore, when depth expansionmeasurement is executed, it is possible to generate a height image in awider range by setting the depth measurement range further upward.Similarly, height images of a measurement object having another shapeare shown in FIGS. 16A and 16B. FIG. 16A shows a height image in whichpixels with low reliability are not displayed. FIG. 16B shows a heightimage in which pixels including the pixels with low reliability aredisplayed. Similarly, in FIG. 16B, by using a region surrounded by abroken line, it can be surmised that the measurement object iscontinuously present further upward. It is possible to determine, fromthis stereoscopic shape data, a direction in which depth is expanded inthe depth expansion measurement.

Pixels at the End Portion of Stereoscopic Shape Data

It is possible to determine, with stereoscopic shape data located at theend portion of a height image, whether the depth expansion measurementis performed. The present invention is not limited to a method ofperforming determination on the basis of pixels at the end portion ofthe stereoscopic shape data. The determination may be performed on thebasis of data in the middle of the depth measurement range. For example,the determination may be performed on the basis of whether a pixel in aposition a predetermined distance apart from the end portion has thestereoscopic shape data. If any pixel in the depth measurement range hasthe stereoscopic shape data, the depth expansion measurement may beexecuted. For example, when a pixel in which a luminance value enoughfor determining that a pattern is projected is obtained is presentsomewhere among pixels in which final stereoscopic shape data is notobtained, the determination processing section may determine that anunmeasured pixel is present and the depth expansion measurement may beexecuted. In this case, in order to avoid noise and misdetection, it isdesirable to set a threshold, for example, set the number, a region, ora volume of pixels having stereoscopic shape data to a fixed or largervalue.

Display-Mode Switching Section

In this way, in the shape measuring program according to thisembodiment, even the pixels with low reliability can be displayed on thedisplay section 400. For example, a normal display mode for notdisplaying pixel data with low reliability and a visualizing mode fordisplaying even the pixel data with low reliability can be switched by adisplay-mode switching section. In the examples shown in FIGS. 15A to16B, FIGS. 15A and 16A show the normal display mode and FIGS. 15B and16B show the visualizing mode.

Determination of Necessity of the Depth Expansion Measurement Based onStereoscopic Shape Data

In the example explained above, the necessity of the depth expansionmeasurement is determined on the basis of the pixel data forming theheight image, that is, the data from which the height information iscalculated. However, the present invention does not limit the necessitydetermination of the depth expansion measurement to the height image andmay be configured to perform the necessity determination on the basis oforiginal data and raw data before the calculation of the heightinformation. Such an example is explained with reference to FIGS. 17 and18. FIG. 17 shows an example of a stripe image formed by projectingstripe patterns on the measurement object. In FIG. 17, since a regionsurrounded by a broken line is present outside the depth measurementrange, contrast of the stripe patterns is low. However, even outside thedepth measurement range, since the stripe patterns are projected,although accuracy is deteriorated compared with the other stripepatterns, the stripe patterns can be used for the necessitydetermination of the depth expansion measurement. That is, in theexample shown in FIG. 17, it can be grasped that the measurement objecthas a shape in a position higher than the depth measurement range(projects in a cylindrical shape). Therefore, it can be determined withthe stripe patterns on the outer side of the depth measurement rangethat it is effective to perform the depth expansion measurement in thisdirection.

Further, in performing the depth expansion measurement, it is alsopossible to determine on the basis of such stereoscopic shape datawhether depth is expanded in the upward direction or expanded in thedownward direction. For example, in an example of the measurement objectshown in FIG. 18, portions outside the depth measurement range arepresent on the upper side and the lower side in the figure. Luminance ishigher in a region on the upper side surrounded by a thick broken linethan a region on the lower side surrounded by a thin broken line. Ingeneral, concerning data outside the depth measurement range, a sideclose to a camera or illumination tends to be bright and a side far fromthe camera or the illumination tends to be dark. Accordingly, it ispossible to distinguish on the basis of the brightness and the contrastof the projection patterns whether the data outside the depthmeasurement range is present on the outer side where the brightness ishigher or the outer side where the brightness is lower. Therefore, it ispossible to surmise in which direction the depth expansion measurementis performed to acquire a height image in this portion.

Moving Pitch

When the height images are coupled to be continuous, a position to whichthe Z stage 142 is moved needs to be set such that a difference betweenZ-stage positions is equal to or smaller than height in the depthmeasurement range to prevent a gap in the height direction from beingformed during the coupling of the height images. In order to smoothlyconnect heights when the height images are combined, as shown in FIG.14D, it is desirable that the difference is slightly shorter than theheight in the depth measurement range such that the depth measurementrange partially overlaps. However, when an overlap region is too large,the number of the height images necessary for the coupling increases. Atradeoff with a measurement time occurs. Therefore, approximately 1% to33%, more desirably 5% to 25%, and still more desirably 10% to 20% ofthe depth measurement range is caused to overlap.

In the generation of a synthesized image, a moving pitch for moving theZ stage in the depth direction in order to capture a plurality of heightimages and a moving pitch for capturing a texture image may be matched.However, the moving pitches do not always need to be matched and canalso be independently set. In particular, concerning the height images,even if a pattern image such as a stripe image is not always in focus,measurement of height information is possible if a contrast differenceor the like can be confirmed. On the other hand, concerning the textureimage, the influence of appearance is large if the texture image is notin focus. Therefore, it is desirable to set the moving pitch of thetexture image finer than the moving pitch of the height image, in otherwords, increase the number of texture images. A clear depth-synthesizedimage substantially entirely in focus is obtained by depth-combining aplurality of texture images photographed at the fine moving pitch. It ispossible to acquire clear texture information and stereoscopic shapedata having height information with large depth by mapping thedepth-synthesized image to a synthesized height image obtained bycombining the height images.

On the other hand, in order to capture a plurality of height images,every time the stage is moved in the depth direction, texture images maybe captured together, the captured texture images may be depth-combined,and the depth-combined texture images may be mapped to a synthesizedheight image obtained by combining the height images. In this case,although clarity of the depth-synthesized image is deteriorated, stagemovement for obtaining the depth-synthesized image is unnecessary otherthan stage movement for capturing the height images. Therefore, there isan advantage that less time is consumed for processing.

A relation between roughness (a relative value) of images duringcoupling and a moving pitch is shown in a graph of FIG. 19. In FIG. 19,the horizontal axis indicates a moving pitch with respect to a depthmeasurement range height and the vertical axis indicates surfaceroughness at the time when planes are obliquely coupled. As shown inFIG. 19, it is seen that the roughness increases as the moving pitch isincreased.

In the example explained above, the moving pitch for moving the Z stageis set to a fixed amount. However, the present invention is not limitedto this configuration. For example, the moving pitch may be set to, forexample, any movement amount designated by the user.

Coupled Region of the Height Images

When the plurality of height images are coupled in this way, treatmentof a region where the height images overlap in the height direction is aproblem. That is, as height information of an overlapping portion ofcoupling target two height images, it is necessary to determine which ofthe height images is used in a synthesized height image. Therefore, thesynthesis processing section 216 decides treatment of the overlappingportion in advance. For example, when a height image HIA obtained inFIG. 14A is coupled to a height image HIB obtained in FIG. 14B, in asynthesized height image CHI shown in FIG. 14D, an upper part of theheight image HIA and a lower part of the height image HIB overlap in anoverlapping region OL1. Similarly, when the height image HIB is coupledto a height image HIC, an upper part of the height image HIB and a lowerpart of the height image HIC overlap in the overlapping region OL1. Insuch a case, the synthesis processing section 216 processes theoverlapping region on the basis of a reliability indicator.

Reliability Indicator

The reliability indicator is an indicator indicating how close heightinformation of pixels in a stage plane, to which the height imagescorrespond, is to a true value, that is, true height in the overlappingregion where the depth measurement region overlaps. When the heightinformation is set to pixel values of pixels forming the height images,the reliability indicator is considered to be an indicator indicatingreliability of the pixel values.

In this way, when the plurality of height images are coupled in thedepth direction, it is possible to obtain a synthesized height imagewith improved reliability of the height information in the overlappingregion by using the reliability indicator without using a simplearithmetic mean or the like.

As a specific reliability indicator, a closer distance from the focalposition of the light receiving section 120 is adopted. When the heightimages are created by the pattern projection method, a pattern image(e.g., a stripe image) is obtained in a position other than the focalposition and calculation of the height information is possible. However,the pattern image is clearer in a position closer to the focal position.Accuracy of the height information tends to be high. Therefore, a focallength is used as the reliability indicator. It can be determined thatthe reliability of obtained height information is also high as thedistance between a focal position at the time when the height image isgenerated and a pixel of attention is shorter.

Alternatively, contrast with peripheral pixels may be used as thereliability indicator. Specifically, as the reliability indicator ofpixels of a certain height image, contrast of corresponding pixels in apattern image, based on which the height image is generated, and pixelslocated around the pixels is used. As the contrast with the peripheralpixels is higher, a boundary forms clearer pattern light and the heightinformation can be accurately calculated. Alternatively, a luminancevalue or the like of an original pattern image may be used as thereliability indicator.

The pixels having the higher reliability indicator can be adopted aspixels of the synthesized height image on the basis of the reliabilityindicator obtained in this way.

In the case of a pixel, height information of which is not obtained inthe first place, the pixel is regarded as null. A pixel, heightinformation of which is obtained, is used. When height information isnot obtained in both the pixels, height information is null in asynthesized height image as well. For example, in a region where thedepth measurement range overlaps, concerning pixel values ofcorresponding XY coordinates of height images, when pixels of one heightimage are valid and pixels of the other height image are null, pixelvalues of the valid pixels are used. Consequently, when a plurality ofheight images are coupled in the depth direction, concerning heightinformation in an overlapping region, it is possible to obtain asynthesized height image in which defective pixels are interpolated.

On the other hand, it is possible to not only adopt a pixel value havinga higher reliability indicator and discard a pixel value having a lowerreliability indicator but also perform weighting. For example, it can beexpected that more accurate height information is obtained by performingweighting to set the specific weight of the pixel value having thehigher reliability indicator to be high and set the specific weight ofthe pixel value having the lower reliability indicator to be low.

Alternatively, height information of the synthesized height image may becalculated on the basis of a weighted arithmetic mean using thereliability indicator.

Difference

It is also possible to extract pixels having predetermined or moredifferences from two height images partially overlapping each other.Specifically, the synthesis processing section 216 can be configured toextract pixels as differences and adopt a pixel value having a highreliability indicator among pixel values of the pixels in the regionwhere the depth measurement range overlaps. In this case, adifferential-pixel extracting section for extracting pixels havingpredetermined or more differences between height images may be providedin the synthesis processing section 216.

Further, in combination of height images in which the depth measurementrange partially overlaps, a condition for selecting or calculatingheight information can also be changed according to a difference amountof data. For example, a pixel having a higher reliability indicator isadopted when a difference of the data is equal to or larger than apredetermined value. Height information of a synthesized height imagemay be calculated on the basis of the weighted arithmetic mean using thereliability indicator when the difference of the data is smaller thanthe predetermined value.

Setting of a Range of Coupled Measurement

When the coupled measurement explained above is carried out, severalmethods for determining a depth measurement range are conceivable: forexample, (1) a method of causing the user to input upper limit and lowerlimit coordinates of the Z stage and measuring and coupling rangesincluding upper and lower limits at a fixed moving pitch; and (2) amethod of causing the user to determine how many stages in the up-downdirection from the present Z-stage height are acquired and carrying outand coupled measurement in a plurality of stages at a fixed movingpitch.

However, in such depth measurement range determining methods, aprocedure for determining a depth measurement range is necessary aspre-processing of the measurement in both the methods. This procedure isnot only time-consuming but, when different height ranges are designatedin a plurality of visual fields, setting is necessary every time theheight range is designated and operation is extremely complicated.Therefore, in this embodiment, a range of the coupled measurement can beautomatically determined.

Setting of a Depth Measurement Range

In order to automatically determine a coupled depth measurement range,in the first embodiment, a depth search range is defined. First, in ashape measuring device shown in FIG. 20, projected beams are irradiatedtoward the measurement object WK as parallel light beams fromsymmetrical angles of a light receiving optical system. A range in whichthe shape measuring device guarantees accuracy and is capable ofperforming measurement is a depth measurement range. In the depthmeasurement range, by carrying out measurement by averaging or combiningmeasurement results by light projection from the left and the right,stabilization and high accuracy of the measurement can be expected.Therefore, the depth measurement range is defined as a “common region”of the projected light beams from the left and the right.

On the other hand, in each of the light beams independently respectivelyirradiated from the left and the right, projected light beams areirradiated in a height range wider than a highly accurately set depthmeasurement range. Therefore, a union region of the respective projectedlight beams on the left and the right fit in a photographing visualfield is defined as a depth search range. Consequently, it is possibleto acquire general height information in a shape outside the depthmeasurement range on the measurement object even if the heightinformation cannot be used for measurement.

Combination of Triangulation Systems

In the shape measuring device according to this embodiment, in order tocarry out more highly accurate measurement, measurement is performed bycombining a space encoding method and a multi slit method or the spaceencoding method and a sine wave phase shift method. However, in a regionbeyond the depth measurement range, in a relation of a depth of field ofan optical system, projected stripe patterns are blurred. It isimpossible to perform height measurement with sufficient resolution andaccuracy. On the other hand, in stripe patterns for performingmeasurement with relatively low resolution of the space encoding method,stripes themselves are sufficiently thick with respect to the depth offield of the optical system as shown in FIG. 17. Therefore, even theregion beyond the depth measurement range often has a rough stripeshape. In FIG. 17, in stripe patterns irradiated on a cylindrical topsurface, stripes are blurred because the stripes are located on thedepth search range. However, a rough stripe shape is maintained. If thischaracteristic is used, it is possible to obtain rough heightinformation inside the depth search range and outside the depthmeasurement range.

In this embodiment, the space encoding method and the multi slit methodor the space encoding method and the sine wave phase shift method arecombined to perform the measurement. However, even if the space encodingmethod is not used, it is possible to obtain the same effects as theeffects of the combined measurement with the space encoding method byrespectively phase-shifting and projecting two or more patterns havingdifferent cycles. For example, it is possible to perform highly accuratemeasurement having an absolute value by projecting a first patternhaving a rough cycle, performing low-resolution measurement of themeasurement object WK by phase-shifting the first pattern, subsequentlyprojecting a second pattern having a short cycle, and performinghigh-resolution measurement of the measurement object WK byphase-shifting the second pattern, and combining these measurements. Inthis case, a result of the low-resolution measurement can be treated inthe same manner as a measurement result of the space encoding method.

Depth-Expansion-Mode Selecting Section 254

As explained above, the shape measuring device according to thisembodiment includes a one-shot measuring function for performingmeasurement once while fixing the Z-stage height and a depth-expansionmeasuring function for coupling results measured at a plurality ofZ-stage heights. As the depth-expansion measuring function, an automaticdepth expanding function for automatically performing depth expansion ora manual depth-expansion measuring function for manually performingdepth expansion can be performed. Alternatively, these functions can beswitched. The shape measuring device causes the depth-expansion-modeselecting section 254 to switch automatic and manual of thedepth-expansion measuring function.

Example 1: Automatic Depth Expansion Based on Cumulative Images

Automatic depth expansion according to an example 1 is explained. It ispossible to automatically expand a range of coupled measurement bycalculating, from rough height information in the depth search range andoutside the depth measurement range, a Z-stage position for measuring,in the depth measurement range, heights of the height information,moving to the position, and performing measurement. As shown in FIG. 21,pixels (measurement pixels), stereoscopic shape data of which areacquired, among pixels forming a visual field are accumulated. In anexample shown in FIG. 21, in an image IG1 captured in a depthmeasurement range HT1, although height can be acquired in a rectangularperipheral region, height cannot be acquired in an elliptical region inthe center. The image IG1 is an image including pixels lacking heightinformation. When the depth measurement range is changed from HT1 to HT2to capture an image IG2, height is obtained in a part of the pixels notmeasured in the image IG1. Similarly, when an image IG3 is captured in adepth measurement range HT3 and an image IG4 is captured in a depthmeasurement range HT4, height is respectively acquired in the lackedpixels. In this way, the pixels in which the height is acquired in eachof the depth measurement ranges are accumulated as shown in FIGS. 22A to22D. For example, in FIG. 22A, the image IG1 is shown. In FIG. 22B, acumulative image obtained by accumulating the pixels, height informationof which is obtained in the image IG2, in the image IG1 is shown.Consequently, it is seen that the unmeasured pixels lacking the heightinformation decrease compared with the image IG1 shown in FIG. 22A.Further, in FIG. 22C, a cumulative image obtained by accumulating thepixels, height information of which is acquired in the image IG3, isshown. The region of the unmeasured pixels is further reduced than inFIG. 22B. In FIG. 22D, pixels obtained in the image IG4 are accumulated.Height information is obtained in the pixels in all the regions. In thisway, presence or absence of unmeasured pixels is determined on the basisof a cumulative image obtained by accumulating acquired pixels. Whenunmeasured pixels are present, the acquisition of stereoscopic shapedata is automatically continued. The pixels forming the visual field aresequentially filled by the measured pixels. The processing is ended at apoint in time when no unmeasured pixel is left.

Stereoscopic Shape Data

The stereoscopic shape data is data for measuring the shape of themeasurement object with the pattern projection method. The stereoscopicshape data does not need to include height information. That is, evendata, height information of which is not measured, is referred to asstereoscopic shape data when the data includes data, height informationof which can be calculated.

Procedure of Automatic Depth Expansion

A procedure of such automatic coupling is shown in FIG. 23. First, instep S3801, the shape measuring device performs measurement.Subsequently, in step S3802, the shape measuring device determineswhether a region having corresponding height is present in the depthsearch range. When the region having the corresponding height ispresent, the shape measuring device proceeds to step S3803 and moves theZ stage 142 to a Z-stage position where a region having thecorresponding height in the depth search range can be measured. In thiscase, an already-measured Z-stage position is excluded. When a pluralityof candidate Z-stage positions are present, the shape measuring devicemoves the Z stage 142 to a closest position. The shape measuring devicereturns to step S3801 and repeats processing such as the measurement. Onthe other hand, when determining in step S3802 that the region in thedepth search range is absent, the shape measuring device proceeds tostep S3804 and ends the measurement.

In this way, in the measurement in the respective positions of the Zstage 142, height information outside the depth measurement range isstored in the depth search range. Consequently, even if Z-stagepositions to which the Z stage 142 should be moved are present on boththe upper and lower sides, it is possible to expand depth in both theupward and downward directions. By preventing the Z stage 142 frommoving to a Z-stage position measured once, it is possible to prevent asituation in which the measurement is performed in an infinite loop.

According to such a procedure, it is possible to perform coupledmeasurement covering all heights of the measurement object. Themeasurement ends at a point in time when the movement of the Z stage 142is unnecessary. Therefore, a total time of the coupled measurement isalways the shortest.

In the automatic depth expansion, an upper limit height of the Z stage142 can also be set. The upper limit height of the Z stage 142 is set toa specified value on the shape measuring device side as a maximum valueof a Z-stage position during the automatic depth expansion. Besides,according to the height of the measurement object placed on the stage140, the upper limit height may be automatically set taking into accounta slight margin or the user may be capable of adjusting the specifiedvalue or the automatically set value or may be capable of designatingany value. Consequently, it is possible to avoid a situation in whichthe Z stage excessively rises during the automatic depth expansion andthe measurement object on the stage collides with the lens.

Modification Concerning the Optical System

In the shape measuring device according to the first embodimentexplained above, the configuration is explained in which the lightreceiving section 120 configuring the imaging section is a single-lenscamera and the two light projecting sections 110 are provided above themeasurement object to project lights from the left and right twodirections. However, the present invention does not limit theconfiguration of the optical system to this configuration. Other opticalsystems can also be adopted. For example, the shape measuring device canalso cause the light projecting section to project light from only onedirection using the single-lens camera as the light receiving section.Alternatively, the shape measuring device may cause the light projectingsection to project light from one direction using a double-eye camera asthe light receiving section instead of the single-eye camera.

Modification Concerning the Measurement Principle

In the shape measuring device according to the first embodiment, thetriangulation method by a gray code and multi slit projection is adoptedas the measurement principle for measuring a three-dimensional shape ofthe measurement object. However, the measurement principle for measuringa three-dimensional shape of the measurement object is not limited tothe triangulation method. Other systems can also be used as appropriate.Methods such as a triangulation method by sine wave light projection, atriangulation method by random pattern light projection, and atriangulation method by line light projection and scan can be used.

Modification Concerning the Moving Mechanism for the Measurement Object

Further, in the shape measuring device according to the first embodimentexplained above, the configuration for directly moving the Z stage 142is adopted as the mechanism for moving the Z stage 142. However, thepresent invention does not limit a moving mechanism for the measurementobject to this configuration. Other configurations can also be used asappropriate. For example, a moving stage having six degrees of freedomof translation and rotation concerning X, Y, and Z axes may be used.Alternatively, the measurement object may be manually automaticallymoved.

Modification Concerning a Working Distance Adjustment Mechanism for theMeasurement Object

Further, in the shape measuring device according to the first embodimentexplained above, the configuration for moving the Z stage 142 andadjusting the working distance between the measurement object and thelight receiving section 120 is adopted. However, the present inventiondoes not limit an adjusting mechanism for the working distance to thisconfiguration. Other configurations can be used as appropriate. Forexample, the light receiving section side may be moved.

Example 2: Automatic Depth Expansion Based on an End Portion of a SingleHeight Image

In the example explained above, the procedure of the automatic depthexpansion for determining the necessity of the depth expansion on thebasis of the cumulative image obtained by accumulating the acquiredpixels is explained. However, the present invention does not alwaysrequire accumulation of pixels in the past in depth expansion andautomatic coupling in the height direction of an image. For example, itis also possible to determine the necessity of the depth expansion froma single height image. Such an example is explained below as a secondexample. As shown in FIGS. 24A to 24D, a height image is acquired in acertain depth measurement range. It is determined whether obtained oneheight image has stereoscopic shape data at an end portion of the depthmeasurement range, that is, an upper limit or a lower limit of the depthmeasurement range. For example, when the height image has stereoscopicshape data at one end portion, it is surmised that the measurementobject is highly likely to extend to the outer side of the depthmeasurement range. Height measurement is performed by changing the depthmeasurement range. It is determined whether the height image hasstereoscopic shape data at the end portion in the same manner in thedepth measurement range after the change. When the height image hasstereoscopic shape data in the same manner, processing is continued byfurther changing the depth measurement range. On the other hand, whenstereoscopic shape data is absent at the end portion, the processing inthis direction is ended, it is determined whether stereoscopic shapedata is present at the other end portion, and the same processing isperformed. When stereoscopic shape data is absent at both the endportions, the processing is ended. The above explanation is an example.For example, when stereoscopic shape data is present at both the endportions, after the depth measurement range is expanded to one endportion, the depth measurement range may be expanded to the other endportion. However, in this method, after the Z stage is expanded in thedirection of one end portion, the Z stage is returned to an originalposition and expanded in the direction of the other end portion. Amovement amount of the Z stage is likely to increase. Therefore, asexplained above, it is desirable to continue the expansion in one of theupward and downward directions once and thereafter expand the depthmeasurement range in the other direction.

Example 3: Automatic Depth Expansion Based on a Pixel in a Range of aSingle Height Image

Further, the present invention is not limited to the method ofdetermining presence or absence of expansion of the depth measurementrange according to whether stereoscopic shape data is present at the endportion of the single height image explained above. The depthmeasurement range may be expanded if a pixel in which stereoscopic shapedata can be measured in the depth measurement range. That is, if, in aheight image acquired in a certain depth measurement range, at least onepixel in which stereoscopic shape data can be measured is present in thedepth measurement range, it is surmised that the measurement object ispresent and depth expansion in the direction of the measurement objectis continued. In this embodiment, since the determination can beperformed only because the height image includes the stereoscopic shapedata, there is an advantage that the determination processing can besimply performed.

Shape Measuring Program Having an Automatic Depth Expansion MeasuringFunction

Examples of a user interface screen of a shape measuring program havingan automatic depth expansion measuring function are shown in FIGS. 25 to29. The shape measuring program shown in these figures also includes theimage display region 410 and the operation region 420. The image displayregion 410 is a region for displaying a texture image and a height imageof the measurement object. The operation region 420 is a region mainlyfor the user to instruct various kinds of operation and for givingexplanation and guidance of operation content to the user. In the screenshown in FIG. 25 and the like, the image display region 410 is disposedin most of the screen from the left side and the operation region 420 isdisposed on the right side. Further, above the image display region 410,as a form of an imaging setting section that performs setting of animaging condition, an imaging setting region 510 for performingmagnification display, focus adjustment, and the like on an imagedisplayed in the image display region 410 is disposed. The dispositionof these components is an example. The disposition, the sizes, and thelike of the members can be changed as appropriate.

Observation-Mode Switching Section

Observation based on a height image and observation based on a textureimage can be performed from the shape measuring program. Switching ofthe observation is performed from an observation-mode switching section.In the example shown in FIG. 25, as a form of the observation-modeswitching section, a “3D measurement” tab 531 and an “image observation”tab 532 are provided in the operation region 420. It is possible toswitch an observation mode by selecting one of the tabs. When the “3Dmeasurement” tab 531 is selected, observation of generation of a heightimage, measurement based on the generated height image, and the like canbe performed. On the other hand, when the “image observation” tab 532 isselected, observation of measurement based on a texture information andthe like can be performed.

Full-Auto Observation Mode

To execute the automatic depth expansion measuring function with theshape measuring program, a “full-auto” button 533 is pressed on thescreen shown in FIG. 25. Consequently, a full-auto observation mode,that is, an automatic depth expansion measurement mode is selected. Inthe full-auto observation mode, expansion in the depth direction isautomatically performed. A synthesized height image of the measurementobject displayed in the image display region 410 is acquired.

Manual Observation Mode

On the other hand, to execute the manual depth expansion measuringfunction with the shape measuring program, a “manual” button 535 ispressed on the screen shown in FIG. 25. Consequently, a manualobservation mode is selected. Expansion in the depth direction can bemanually performed. An example of the manual observation mode is shownin FIG. 26. On a manual observation screen 540 shown in this example, a“Z-measurement range” designation field 541, a “measurement mode”selection field 542, a “measurement direction” designation field 543, a“measurement brightness” setting field 544, and a “texturephotographing” selection field 545 are provided in the operation region420.

“Z-Measurement Range” Designation Field 541

The “Z-measurement range” designation field 541 is a form of thedepth-expansion-mode selecting section 254 that selects the depthexpansion measurement mode. In this example, as shown in FIG. 26, in the“Z-measurement range” designation field 541, the user can select any oneof “automatic”, “measurement”, and “manual” from a drop box. When the“automatic” is selected, an automatic depth expansion mode forautomatically executing the depth expansion measurement is selected.When the “manual” is selected, a manual depth expansion mode for theuser to manually execute the depth expansion measurement is selected. Onthe other hand, when the “measurement” is selected, measurement of apredetermined depth range is performed. In other words, the depth rangeis not expanded and a height image is generated in a predeterminedheight range measurable by the shape measuring device. The measurementis equivalent to the one-shot measuring function for performing one timeof measurement with the Z-stage height fixed explained above.

The “measurement mode” selection field 542 is a form of themeasurement-mode selecting section 257 that selects a measurement mode.The measurement mode is a mode for adjusting an imaging condition of astripe image captured in generation of a height image to make itpossible to perform measurement corresponding to a use of observation. Aplurality of measurement modes are prepared in advance. The user selectsa desired measurement mode according to, for example, a purpose ofobservation. In the “measurement mode” selection field 542, any one ofthe plurality of measurement modes is designated. As shown in FIG. 27,any one of “auto”, “standard”, “reflection/sneaking removal mode”, and“high definition (roughness)” can be selected from a drop box.

When the “auto” is selected, an auto measurement mode for automaticallyselecting an appropriate measurement mode out of the plurality ofmeasurement modes is selected.

When the “standard” is selected, a standard measurement mode isselected.

When the “reflection/sneaking removal” is selected, areflection/sneaking light removal mode suitable for removal ofreflection of projected light and sneaking light is selected. Thismeasurement mode is called fine measurement mode and the like as well.In the reflection/sneaking light removal mode, projection patterns ofmeasurement light are finer than projection patterns in the standardmeasurement mode. The reflection/sneaking light removal mode is a modefor removing indirect light components such as sneaking light, multiplereflection, and irregular reflection. The reflection/sneaking lightremoval mode is highly effective when the measurement object is asemitransparent body such as clouded resin and an uneven metal body suchas a screw. Time required for measurement is longer than the time in thestandard measurement mode.

When the “high definition (roughness)” is selected, a high definitionmode for generating a higher definition height image such as measurementof roughness of the surface of the measurement object is selected.

Other measurement modes may be added. For example, a halation removalmeasurement mode has the same projection patterns as the projectionpatterns of the standard measurement mode. However, the halation removalmeasurement mode is a measurement mode for expanding and measuring adynamic range by changing an exposure time or a projected light amountof measurement light. Consequently, there is an effect that black solidand white void can be prevented in an object having an intense contrastdifference. For example, the halation removal measurement mode iseffective in an object in which black resin is embedded in a metal body.Time required for measurement is longer than the time in the standardmeasurement mode. Further, a superfine measurement mode is a combinationof the reflection/sneaking light removal mode and the halation removalmeasurement mode. Accuracy can be improved most. However, time requiredfor measurement is the longest.

In the “measurement direction” designation field 543, the lightprojecting section 110 is designated. One or both of the first lightprojecting section 110A and the second light projecting section 110Bshown in FIG. 4 can be selected. In the example shown in FIG. 28, anyoneof “only left side”, “only right side”, and “both” can be selected froma drop box provided in the “measurement direction” designation field543.

When the “only left side” is selected, the first light projectingsection 110A shown in FIG. 4 is selected and only projected light fromthe left side is obtained. When the “only right side” is selected, thesecond light projecting section 110B shown in FIG. 4 is selected andlight is projected from only the right side. When the “both” isselected, the first light projecting section 110A and the second lightprojecting section 110B shown in FIG. 4 are selected and lights areprojected from both the sides.

In the “measurement brightness” setting field 544, the brightness of animage displayed in the image display region 410 is adjusted. Adjustmentof the brightness of a texture image can be performed by adjusting, forexample, an exposure time and shutter speed of the light receivingsection 120, which is the imaging section. In the “measurementbrightness” setting field 544, it is possible to switch, with a radiobutton, auto brightness adjustment for automatically performing theadjustment of the brightness of the texture image and manual brightnessadjustment for manually adjusting the brightness of the texture image.For example, as shown in FIG. 29, when the “auto” is selected,brightness is automatically adjusted to appropriate brightness accordingto an image currently displayed in the image display region 410. Whenthe “manual” is selected, the user can manually adjust the brightness ofthe image. The brightness of the texture image is adjusted by a slider.The brightness of the image displayed in the image display region 410 isreflected, on a real time basis, on the brightness after the adjustmentin the “measurement brightness” setting field 544.

Texture-Image Selecting Section 460

In the “texture photographing” selection field 545, which is a form of atexture-image selecting section 460, a texture image to be photographedis selected. “Normal” and “HDR” can be selected by a radio button. Whenthe “normal” is selected, a normal texture image is photographed. On theother hand, when the “HDR” is selected, an HDR image is photographed.Other texture images can also be selected. For example, a depthsynthesized image can also be selected.

Example 3: Manual Depth Expansion

In the example explained above, the example is explained in which thedepth expansion and the coupled measurement are automatically performed.However, the present invention is not limited to the configuration forautomatically performing the depth expansion. The depth expansion can bemanually performed. A procedure for manually performing the depthexpansion using the manual depth expanding function and generating asynthesized height image from a plurality of height images havingdifferent heights is explained with reference to a flowchart of FIG. 30and FIGS. 31A to 31G. First, in step S3001, the shape measuring devicecauses the display section 400 to display an optical image of ameasurement object, a synthesized height image of which the user desiresto acquire. The shape measuring device causes the user to place themeasurement object on the Z stage 142, acquires an optical image, andcauses the display section 400 to display the optical image. As anexample, an optical image A in which the measurement object is displayedis shown in FIG. 31A. At this time, the user may perform adjustment of afocal position or the adjustment of the focal position may beautomatically performed. Alternatively, the adjustment of the focalposition may not be performed. Examples of a method of automaticallyadjusting the focal position include a method of clicking a mouse in adesired position on the optical image to automatically focus on adesignated position.

In step S3002, the user designates, as a height designation position, aposition where the user desires to acquire a height image. On theoptical image displayed on the display section 400, the user designates,with the operation section, a height designation position where the userdesires to acquire a height image. At this time, since the optical imageis a two-dimensional image, designation of the height designationposition is designation on the XY plane. For example, when the userclicks a desired position on the display section 400, a Z-coordinateposition of the XY plane is recorded as the height designation position.The autofocus may be automatically executed on the basis of the heightdesignation position. Consequently, it is possible to more clearlydisplay the optical image in the height designation position.

In step S3003, the shape measuring device generates a height image inthe designated height designation position. For example, the userpresses a height image generation button on the user interface screen ofthe shape measuring program. Consequently, the shape measuring deviceacquires height information (a Z coordinate) in the designated heightdesignation position (XY coordinate) and generates a height image in apredetermined depth measurement range on the basis of the heightinformation. As an example, a height image D obtained in a heightdesignation position designated on the optical image A shown in FIG. 31Ais shown in FIG. 31D. The height image D does not always need to bedisplayed on the display section and may not be displayed. The shapemeasuring device can perform processing on the background withoutcausing the user to be aware of intermediate generation work for aheight image. However, the shape measuring device may display the heightimage D and cause the user to confirm the height image D. The shapemeasuring device temporarily saves the generated height image D in orderto use the height image D in generation processing for a synthesizedheight image explained below.

When receiving the designation of the height designation position instep S3002, the shape measuring device may automatically execute thegeneration of the height image in step S3003. Consequently, the laborand time of the operation on the user side can be reduced. For example,when the user single-clicks any position on the optical image, theautofocus works and, when the user double-clicks any position on theoptical image, the acquisition processing for a height image isexecuted. Consequently, the user can perform the adjustment of the focalposition, the designation of the height designation position, and thegeneration processing for the height image with less operation.

In step S3004, the user determines whether another height designationposition is designated. That is, the user determines whether a necessarynumber of height images are obtained in order to combine height imagesgenerated at different heights. The shape measuring device receives aninstruction of the user concerning whether to designate another heightdesignation position or end the designation of the height designationposition and proceeds to generation of a synthesized height image.

When the user desires to add a height image, that is, when the userdesires to further designate another height designation position, theuser returns to step S3002 and designates another height designationposition. At this time, the user designates a height designationposition on the same image as the optical image on which the user hasalready designated the height designation position. In other words, theuser does not change a visual field of the optical image. This isbecause it is necessary to acquire height images at different heightswith respect to the measurement object in the same posture in order togenerate a synthesized height image. If the user desires to change thevisual field of the optical image, the user returns to step S3001 andrepeats the processing from the display of the optical image.

In the designation of another height designation position, it isnecessary to designate, on the optical image, height different from theheight of the already designated height designation position. Therefore,it is desirable to change the focal position of the optical image. Inthis case, the user manually adjusts the focal position. Besides, thefocal position may be automatically adjusted. For example, as explainedabove, it is possible to use a method of automatically executing theautofocus at a designated position when the user clicks a desiredposition on the optical image. As an example, an example of an opticalimage B in which a position higher than the height designation positiondesignated in FIG. 31A is designated as a height designation positionwith respect to the same measurement object as the measurement objectshown in FIG. 31A is shown in FIG. 31B. An optical image C adjusted to afocal position higher than a focal position shown in FIG. 31B is shownin FIG. 31C. Further, a height image E generated in the heightdesignation position designated in FIG. 31B is shown in FIG. 31E. Aheight image F generated in a height designation position designated inFIG. 31C is shown in FIG. 31F.

In this way, the user needs to acquire a plurality of height images indifferent height ranges such that the height images include all rangesof the measurement object. It is desirable to sequentially designateheight designation positions from a low position to a high position orfrom a high position to a low position in different heights of themeasurement object. In order to make it possible to appropriatelydesignate such a plurality of different height designation positions,for example, height information of designated height designationpositions may be displayed in a designated height designation positiondisplay field on the display section 400. A list of height informationmay be updated every time a height designation position is added.

When the additional height designation position is designated in thisway, similarly, the shape measuring device proceeds to step S3003,generates a height image in the designated height designation position,and temporarily saves the height image. In step S3004, similarly, theshape measuring device determines necessity of an additional heightdesignation position.

When the user determines that all the necessary height images areobtained in this way, the user proceeds to step S3005 and instructsgeneration of a synthesized height image. The shape measuring devicecombines the obtained plurality of height images in the depth directionand generates, with the synthesis processing section 216, a synthesizedheight image having a wider depth range. As an example, a synthesizedheight image G obtained by combining the height image D shown in FIG.31D, the height image E shown in FIG. 31E, and the height image F shownin FIG. 31F is shown in FIG. 31G. In this way, the plurality of heightimages are combined. It is possible to obtain a height image in a heightrange wider than a height range physically measurable by the shapemeasuring device.

The procedure of the manual depth expansion explained above may beimparted with a guidance function to guide, with the shape measuringdevice, the user to perform a procedure that the user should perform.For example, if a shape measuring program causes the user to execute themanual depth expansion, it is possible to display, on the displaysection, operation that the user should perform and guide the user toperform a procedure that the user should perform. With this method, evena user unfamiliar with the operation of the shape measuring device caneasily generate a synthesized height image if operation that the usershould perform is presented to guide the user.

Automatic Image XY Coupling Function

With the shape measuring device according to this embodiment, in imagecoupling for coupling stereoscopic shape data such as height images inthe XY direction, it is also possible to individually adjust measurementsetting in generating the stereoscopic shape data and automate work ofthe adjustment. For example, in XY coupling for coupling images on theXY plane, which is a plane orthogonal to the optical axis direction ofthe light receiving section, it is assumed that, as shown in FIG. 32, animage captured at low magnification or a coupled map image fornavigation is formed as a wide area image, the wide area image isdivided into a plurality of partial regions, and height images, whichare stereoscopic shape data, generated in the partial regions arecoupled in the XY direction to generate a synthesized height image. Insuch image coupling processing on the XY plane, in generating the heightimages in order in the partial regions, it is necessary to setmeasurement setting for performing measurement. If the measurementsetting is set in common in the partial regions, height images withsufficient accuracy sometimes cannot be obtained. For example, when themeasurement object is partially formed of a different material, forexample, projected pattern light is multiply reflected on a glossysurface such as metal or the pattern light causes sneaking in asemitransparent resin portion. Consequently, correct height images aresometimes not obtained in normal measurement. In this case, whereas itis necessary to measure height images in measurement setting suitablefor the multiple reflection and the sneaking of the light, generation ofheight images takes time because it is necessary to perform imaging aplurality of times. Therefore, when height images are generated in thesame measurement setting in all the partial regions, total consumed timeis long. Similarly, when a region where uneven undulation is large and aflat region are mixed in the measurement object, whereas it is necessaryto drive the Z stage in the depth direction and repeat imaging atdifferent heights in the region having level differences of unevenness,if the imaging at the different heights is repeated in the same mannerin the flat region, unnecessary operations increase and more time isconsumed. It is also conceivable that the user individually manuallysets appropriate measurement setting for such various partial regions.However, this work is extremely time consuming.

Further, on the other hand, when the shape measuring device causes theuser to display stereoscopic shape data after the measurement for eachof the partial regions and the user desires to perform shape measurementof the partial region again, it is also conceivable to adopt a method ofperforming the measurement again after changing the measurement settingand, when a desired measurement result is obtained, replacing thestereoscopic shape data with stereoscopic shape data obtained anew.However, even in this case, the user has to confirm measurement resultsone by one and determine necessity of remeasurement. This method is timeconsuming. It is sometimes not easy to determine how the measurementsetting should be changed to obtain the desired measurement result. Thismakes the work more complicated.

Therefore, in this embodiment, when such stereoscopic shape data such asthe height images are XY-coupled to generate synthesized stereoscopicshape data, the adjustment work for the measurement setting is automatedto make it possible to easily acquire stereoscopic shape data having awide visual field. That is, the burden on the user is reduced by makingit possible to individually automatically adjust setting conditions forthe plurality of partial regions. In particular, it is possible toadjust the partial region measurement setting to appropriate conditionson the basis of light reception data and stereoscopic shape data onceacquired, generate stereoscopic shape data again with the measurementsetting for the partial regions after the adjustment according tonecessity, and obtain stereoscopic shape data having higher quality orhigher accuracy. It is also possible to omit the process of theautomatic adjustment of the measurement setting and achievesimplification of the processing by saving the measurement setting forthe partial regions adjusted for each of the partial regions to read outthe measurement setting when inspection of the same measurement objectis performed.

Measurement-Setting Automatically Adjusting Section 217

The measurement-setting automatically adjusting section 217 shown inFIG. 1 and the like performs such automatic adjustment of themeasurement setting. In the image XY coupling, the measurement-settingautomatically adjusting section 217 fully automatically performs theadjustment of the partial region measurement setting. Besides, themeasurement-setting automatically adjusting section 217 mayautomatically adjust measurement setting set by the user with themeasurement setting section 255 or, conversely, the user may adjust,with the measurement setting section 255, measurement settingautomatically adjusted by the measurement-setting automaticallyadjusting section 217. In the automatic setting, the measurement-settingautomatically adjusting section 217 can also adjust measurement settingset as an initial value on the shape measuring device side and use themeasurement setting as adjusted measurement setting. In this way, themeasurement-setting automatically adjusting section 217 fullyautomatically adjusts the measurement setting for generatingstereoscopic shape data such as height images. Besides, the measurementsetting may be semi-automatic combination with setting by the user. Themeasurement setting section 255 is a member for the user to manually setinitial measurement setting. However, the measurement setting section255 may be a member for inputting an initial setting value of themeasurement setting prepared in advance on the shape measuring deviceside. The measurement setting for the partial regions is a conditionobtained by automatically adjusting, with the measurement-settingautomatically adjusting section 217, partial region measurement settingdesignated by the user or the initial setting value prepared on thedevice side.

Reflected Light and Sneaking Light Removal Mode

A measurement mode for performing, when reflected light and sneakinglight are present, measurement in measurement setting for removing thereflected light and the sneaking light is explained. For example, anexample of a height image generated when measurement is performed, ingeneral measurement setting, on a measurement object including asemitransparent diffusion plate made of resin as shown in FIG. 33, thatis, a height image generated from a strip image by projecting patternlight is shown in FIG. 34A. As shown in FIG. 34A, in a normal scan mode,the semitransparent diffusion plate portion cannot be successfullymeasured because of the influence of the sneaking light. Data of aheight image is defective. On the other hand, an example of a heightimage measured when the measurement mode is set to a reflection/sneakinglight removal mode is shown in FIG. 34B. As explained above, in thereflection/sneaking light removal mode, an indirect light component isreduced by setting a projection pattern of measurement light finer thanusual. As a result of the measurement in the sneaking light removalmode, as shown in FIG. 34B, it is seen that the semitransparentdiffusion plate portion can be measured in a relatively large portion.

However, in such a special measurement mode, a processing time is longerthan usual. Therefore, when the measurement is performed in the sneakinglight removal mode in all the partial regions or in all XY positions, ameasurement time is long. Therefore, the measurement time can be reducedby using this measurement mode only for a region where a lot of sneakinglight or multiple reflection light is present. In the example explainedabove, a height image is once generated in the standard measurementmode. In the partial region where the defective region occurs as shownin FIG. 34A, the partial region measurement setting is reset by themeasurement-setting automatically adjusting section 217, a height imageis generated again and substituted. Consequently, it is possible toobtain a height image with a small defective portion as shown in FIG.34B.

Similarly, it is possible to compress the measurement time andefficiently perform the measurement processing by limiting a depth rangein a region with a small level difference, although a depth range isexpanded and measurement is performed concerning a region with a largelevel difference of the measurement object. For example, in the examplesshown in FIGS. 34A and 34B, whereas long time is consumed when heightranges (ranges indicated by arrows in FIG. 32) of the measurement objectare measured in all the XY positions, it is possible to reduce themeasurement time by performing the measurement in the depth expansionmeasurement mode concern only regions in the outer periphery of themeasurement object (the partial regions located around the coupledregion in FIG. 32) and, on the other hand, not performing the Z-rangeexpansion in the other Partial regions (the partial regions located onthe inside of the coupled region in FIG. 32).

Distinction of Sneaking Light and a Void

In the automatic selection of the measurement mode, when a defectiveportion occurs in a part of a height image, the measurement-settingautomatically adjusting section 217 distinguishes whether the defectiveportion is caused by sneaking light or a shape itself is defective inthe first place (a void, a hole, or the like). In other words, whendetermining that the defective portion is caused by the sneaking light,the measurement-setting automatically adjusting section 217 performsremeasurement with the partial region measurement setting changed.However, when determining that the defective portion is caused by thevoid, the measurement-setting automatically adjusting section 217 doesnot perform the remeasurement. As example of such a determining methodis explained with reference to FIGS. 35A to 35D. FIG. 35A shows an imagediagram of a stripe image of a certain measurement object. FIG. 35Bshows a luminance profile of a metal portion in the measurement objectshown in FIG. 35A. FIG. 35C shows a luminance profile of a hole portion.FIG. 35D shows a luminance profile of a white resin portion. Concerningthe metal portion shown in FIG. 35B, it is seen that a clear peakappears in the luminance profile and height information can be correctlymeasured. On the other hand, both of the hole portion shown in FIG. 35Cand the white resin portion shown in FIG. 35D are black on the stripeimage. Pattern light is not obtained. However, it is seen that, whereasa base portion of the luminance profile is nearly zero in the holeportion shown in FIG. 35C, constant displacement (luminance) is obtainedin a base portion in the resin portion shown in FIG. 35D. In this way,in both of FIGS. 35C and 35D, although a peak is hardly obtained on theluminance profile, according to whether a luminance signal is obtainedin the base portion, it is possible to distinguish, with themeasurement-setting automatically adjusting section 217, whether a shapeis absent or luminance is not obtained because of sneaking of light.

Procedure of Automatic-Image-XY-Coupling Processing

A procedure of automatic-image-XY-coupling processing for generatingsynthesized stereoscopic shape data is explained with reference to aflowchart of FIG. 36. First, in step S3601, the user initializes theposition of the stage 140. The stage 140 is an electric XY stage.

Subsequently, in step S3602, the user places a measurement object on theXY stage. In this state, the user causes the display section to displayan optical image, adjusts magnification (step S3603), and adjusts afocal position (step S3604). The order of these steps may be changed asappropriate.

Creation of a Map Image

In step S3605, the shape measuring device creates a map image. The mapimage is a wide area image having a visual field of the same degree as avisual field of synthesized stereoscopic shape data that the userdesires to obtain. For the creation of the map image, it is possible touse, for example, a method of moving the XY stage in a swirl shape and amethod of automatically moving the visual field.

Swirl-Shape-Map-Image Creating Method

The method of moving the XY stage in a swirl shape is explained withreference to FIGS. 37A to 37C. First, the user designates an initialposition. As shown in FIG. 37A, the user causes the display section todisplay a part of the measurement object. The initial position isdesirably set near the center of the measurement object. Afterdetermining the initial position in this way, when the user instructs astart of swirl-shape map image creation, the visual field isautomatically moved centering on the initial position. Optical images ofthe moved visual field are sequentially captured. For example, as shownin FIG. 37B, the visual field is moved downward from the initialposition and an optical image is captured. The visual image is furthermoved to the left and an optical image is captured. In this way, thevisual field is sequentially moved in a swirl shape and optical imagesin respective positions are captured. The shape measuring device movesthe XY stage with the stage-plane-direction driving section 148 suchthat the visual field is moved clockwise centering on the initialposition. In this way, the visual field is gradually enlarged and a mapimage is created. The user instructs an end of the swirl-shape-map-imagecreation processing at a point in time when a desired visual field ofthe measurement object is obtained while viewing the display section.For example, the user presses a stop button to end theswirl-shape-map-image creation processing. In this way, a map image iscreated in a swirl shape.

Designation of an XY-Coupled Region

In step S3606, the user designates an XY-coupled region where XYcoupling is performed. A designation method for an image XY-coupledregion where automatic coupling is automatically performed is selected.Concerning the XY-coupled region, a method of manually designating theXY-coupled region and a method of automatically designating theXY-coupled region can be used. Examples of the method of manuallysetting the XY-coupled region are shown in FIGS. 38A to 38C. In thesemethods, the user manually sets a start point and an end point of anautomatic XY-coupled region. For example, in the example shown in FIG.38A, the user sets the start point and the end point of the automaticXY-coupled region. Specifically, the user designates positions of thestart point (at the left end and the upper end) and the end point (theright end and the lower end) of the XY-coupled region while confirmingan image displayed on a screen. Alternatively, as shown in FIG. 38B, theXY-coupled region may be designated by a “start point” and a “length”.In this example, the user determines a position of the start point (theleft end and the upper end) of the XY-coupled region and designateslongitudinal and lateral lengths of the region from the start point.Alternatively, as shown in FIG. 38C, the XY-coupled region may bedesignated by a “start point” and a “number of images”. In this example,the user determines a position of the start point (the left end and theupper end) of the XY-coupled region and designates how many images aremeasured and coupled longitudinally and laterally from the position.

An example of the method of automatically setting the XY-coupled regionis shown in FIG. 39. In this example, the shape measuring device sets,with image processing, an outer edge of the measurement object as anedge region and automatically determines the XY-coupled region such thatthe edge region is interpolated.

Automatic Setting Method for the XY-Coupled Region

Examples of such a method of automatically setting the XY-coupled regioninclude a method of photographing a map image and determining theXY-coupled region before measurement and thereafter starting measurementand a method of determining the XY-coupled region while analyzingstereoscopic shape data during measurement. These methods are explainedwith reference to flowcharts of FIGS. 40 and 41.

First, a method of determining the XY-coupled region in a map image andthereafter starting measurement is explained with reference to theflowchart of FIG. 40. First, in step S4001, the shape measuring devicephotographs a texture image of a measurement object in the presentposition on the stage 140. Subsequently, in step S4002, the shapemeasuring device converts the texture image into a binary image obtainedby extracting only a contour portion of the measurement object from thetexture image. The shape measuring device extracts a stage surface and acontour of the measurement object. In step S4003, the shape measuringdevice determines from the binary image to which side of upper, lower,left, and right sides the measurement object extends and moves the XYstage in the direction of the side. In step S4004, the shape measuringdevice determines whether a texture image of the entire measurementobject is obtained. When a texture image of the entire measurementobject is not obtained, the shape measuring device repeats steps S4001to S4003.

When a texture image of the entire measurement object is obtained, theshape measuring device proceeds to step S4005. The shape measuringdevice extracts edge portions of the measurement object and the stagesurface from the map image and automatically sets an XY-coupled regionin which the edge portions fit. Further, in step S4006, the userconfirms a region set before a measurement start and sets an excludedregion if necessary. Finally, in step S4007, the shape measuring devicestarts measurement in the XY-coupled region specified in this way.

A method of setting an XY-coupled region while analyzing stereoscopicshape data during measurement is explained with reference to theflowchart of FIG. 41. First, in step S4101, the shape measuring deviceperforms measurement of a measurement object in the present position ofthe stage 140. The shape measuring device captures a texture image.Subsequently, in step S4102, the shape measuring device converts thetexture image into a binary image obtained by extracting only a contourportion of the measurement object from the texture image. In step S4103,the shape measuring device determines from the binary image in whichsurface of upper, lower, left, and right surfaces the measurement objectextends and moves the XY stage in the direction of the surface. Further,in step S4104, the shape measuring device determines whether a textureimage of the entire measurement object is captured. When a texture imageof the entire measurement object is not captured yet, the shapemeasuring device returns to step S4101 and repeats the work explainedabove. In this way, the shape measuring device captures the textureimage of the entire measurement object. In this example, the method ofsetting the XY-coupled region on the basis of the texture image isexplained. However, the method of setting the XY-coupled region is notlimited to this method. For example, it is also possible to analyzestereoscopic shape data such as a height image and determine theXY-coupled region.

The XY-coupled region is automatically set in this way. Referring backto the screen shown in FIG. 39, an optical image, the magnification ofwhich is adjusted such that the entire view of the measurement object isdisplayed, is displayed in the image display region 410. A rectangularXY-coupled region, which is a target of image coupling, is shown overthe measurement object. Further, the XY-coupled region is divided into aplurality of partial regions and displayed in a grid shape. In thisexample, an automatically calculated XY-coupled region is automaticallydivided into partial regions. In this state, the user may change settingaccording to necessity while confirming the measurement object, theXY-coupled region, and the partial regions displayed in the imagedisplay region 410. In the example shown in FIG. 39, the longitudinaland lateral sizes and the number of the partial regions are displayed inan operation region to correspond to the partial regions displayed inthe image display region 410. The user can adjust values of the sizesand the number of the partial regions. The shape measuring device canalso display, in the operation region, a procedure that the user shouldperform and can guide setting. In this example, as “setting of ameasurement region”, “Adjust the position and the size of a rectangle tobe fit, within a frame, a range that you desire to measure. You candesignate and set the sizes and the number of the partial regions” isdisplayed.

A mask region where measurement is not performed may be set. In theexample shown in FIG. 39, a “Set a coupling excluded region” check fieldis provided in the display region as a mask region setting section. Asexplanation of the mask region setting section, “Set a measurementunnecessary part as an excluded region” is displayed as a text to guidethe user to set the excluded region.

It is not particularly necessary to include the entire region of themeasurement object in the XY-coupled region. It is sufficient for theuser to acquire stereoscopic shape data of only a part of attention onthe measurement object such as a region where the user desires toperform measurement such as a region where the user desires to confirm asurface state, a part where the user desires to measure height, or aregion where the user desires to inspect presence of absence of a crackor a chip. Accordingly, it is possible to efficiently perform shapemeasurement by, for example, setting a partial region only in anecessary region or setting a mask region in a region where measurementis unnecessary.

In this specification, for convenience of explanation, the example isexplained in which the XY-coupled region is divided into a plurality ofpartial regions. However, it is not always necessary to divide theXY-coupled region. For example, as shown in FIG. 43 referred to below,the user may individually designate a region that the user desires toperform measurement. In this way, in this specification, a plurality ofmeasurement target regions are collectively referred to as XY-coupledregion. A subset of the XY-coupled region is referred to as partialregion.

In a state in which the XY-coupled region is set in this way,measurement setting for measuring stereoscopic shape data is set. Theshape measuring device selects, with the depth-expansion-mode selectingsection 254, a depth expansion measurement mode for determining presenceor absence and a range of expansion in the depth direction as shown inFIG. 26, selects a measurement mode with the measurement-mode selectingsection 257 as shown in FIG. 27, selects, with the measurement-directiondesignating section, a measurement direction by the light projectingsection 110 as shown in FIG. 28, and sets, with themeasurement-brightness setting section, brightness of an image displayedin the image display region 410 as shown in FIG. 29.

In a state in which the measurement setting is set in this way, theshape measuring device starts coupled measurement in step S3608. Theshape measuring device receives pressing of the “measurement” button bythe user. In step S3609, the shape measuring device executesmeasurement, generates stereoscopic shape data, and photographs atexture image.

Subsequently, in step S3610, the shape measuring device determineswhether a region in the depth search range is present. When a region inthe depth search range is present, the shape measuring device proceedsto step S3611. The shape measuring device moves the Z stage to a heightposition where the region in the depth search range can be measured. Inthis case, an already measured height position is excluded. When aplurality of height positions are present, the shape measuring devicemoves the Z stage to a closest height position. The shape measuringdevice returns to step S3609 and repeats the processing.

On the other hand, when a region in the depth search range is absent,the shape measuring device proceeds to step S3612 and determines whetherall of synthesized image data in the coupled region are generated. Whennot all of the synthesized image data in the coupled region aregenerated, that is, when an unmeasured partial region is present, theshape measuring device moves the XY stage to the partial region in stepS3613 and then returns to step S3609 and repeats the processing.

When ending the measurement of the partial regions and determining thatall of synthesized height image data in the coupled region aregenerated, in step S3614, the shape measuring device causes the displaysection to display a generated synthesized height image.

In this way, it is possible to generate a wide area synthesized heightimage obtained by XY-coupling synthesized height images.

Automatic Adjustment of Partial Region Measurement Setting

On the other hand, in the generation of such a wide area synthesizedheight image, it is also possible to automatically adjust the partialregion measurement setting for each of the partial regions. A procedurefor generating such a wide area synthesized height image is explainedwith reference to a flowchart of FIG. 42. First, in step S4201, the userplaces the measurement object on the stage 140. Subsequently, in stepS4202, the shape measuring device creates a map image. Further, in stepS4203, the shape measuring device performs setting of a continuousregion. The work in these steps is the same as the work in steps S3601to S3606 in FIG. 36 explained above. Detailed explanation of the work isomitted.

In step S4204, the shape measuring device moves the XY stage to apredetermined partial region. The shape measuring device moves, with theplane-direction driving section, the XY stage to a partial region wherestereoscopic shape data is generated first.

In step S4205, the shape measuring device sets measurement setting inthe partial region. The shape measuring device sets an initial value ofthe measurement setting in the partial region where stereoscopic shapedata is generated first. The initial setting value of the measurementsetting may be designated on the shape measuring device side. Themeasurement-setting automatically adjusting section 217 mayautomatically analyze the measurement setting from an optical image ofthe partial region. Alternatively, the user may manually set themeasurement setting.

In step S4206, the shape measuring device executes measurement. Theshape measuring device generates stereoscopic shape data with thestereoscopic-shape-data generating section and photographs a textureimage with the texture-image acquiring section 218.

In step S4207, the shape measuring device automatically adjusts thepartial region measurement setting. The measurement-settingautomatically adjusting section 217 changes the partial regionmeasurement setting to changed measurement setting of the partial regionaccording to necessity. In step S4208, the shape measuring devicedetermines whether measurement needs to be performed again in themeasurement setting of the partial region. When determining that themeasurement needs to be performed again, the shape measuring devicereturns to step S4206 and generates stereoscopic shape data again.Re-photographing of a texture image is unnecessary. As the determinationof the necessity of the remeasurement, the shape measuring devicedetermines that the remeasurement is unnecessary, for example, when themeasurement-setting automatically adjusting section 217 determines thatthe partial region measurement setting is appropriate and does notchange the partial region measurement setting.

After the measurement is executed in this way, the shape measuringdevice proceeds to step S4209 and determines whether an unmeasuredpartial region is present. When an unmeasured partial region is present,the shape measuring device returns to step S4204 and performs movementto the unmeasured partial region and measurement of the unmeasuredpartial region in the same manner.

When the measurement of all of the partial regions ends, the shapemeasuring device proceeds to step S4210 and combines obtainedstereoscopic shape data to create synthesized stereoscopic shape data.

In this way, it is possible to automatically adjust the partial regionmeasurement setting, perform remeasurement to acquire stereoscopic shapedata again according to necessity, and finally obtain wide areasynthesized stereoscopic shape data at high quality.

Editing of XY-Coupled Measurement Setting

After the completion of the coupled measurement, the user can confirm ameasurement result. For example, the user can cause the display sectionto display an obtained wide area synthesized height image and visuallyconfirm whether a desired result is obtained. According to necessity,the user can change divided measurement setting and perform measurementagain in the partial regions. In this case, the user can re-edit thepartial region measurement setting.

The user regenerate a wide area synthesized height image using heightimages obtained by performing measurement again in only a part of thepartial regions.

Further, by saving the measurement setting in the partial regions in themeasurement-setting saving section 243, the user can reuse themeasurement setting when executing an inspection. For example, whenperforming a non-defective product test for checking a differencebetween a measurement object and a reference measurement object, theuser can consume a rather long time for work for setting measurementsetting of the partial regions from the reference measurement objectsuch that a correct result is obtained in a short time during theoperation of the inspection. Consequently, it is possible to executequick and highly accurate measurement during the inspection operation.

Continuous Measurement Mode

In this case, the stereoscopic-shape-data generating section can switcha normal measurement mode and a continuous measurement mode. The normalmeasurement mode is a measurement mode for changing, with themeasurement-setting automatically adjusting section 217, the partialregion measurement setting for each of the partial regions andgenerating stereoscopic shape data as explained above. On the otherhand, the continuous measurement mode is a measurement mode for readingout, for each of the partial regions, the partial region measurementsetting saved in advance in the measurement-setting saving section 243and generating stereoscopic shape data. In other words, in thecontinuous measurement mode, it is possible to achieve a reduction in aprocessing time by reading out and using the saved partial regionmeasurement setting without automatically adjusting the partial regionmeasurement setting.

For example, it is assumed that measurement of a measurement objectpartially including protrusions on the surface shown in a side view ofFIG. 43 is performed. The protrusions have different colors. Themeasurement object includes a semitransparent resin portion in a part ofthe surface. An example is explained below in which the partial regionsA to Dare set on such a measurement object. In this case, the partialregion measurement setting of the partial regions is set and saved inadvance as shown in FIG. 44. For example, colors of materials aredifferent in the partial region A and the partial region B. Therefore,contrast of respective stripe patterns is easily represented bydifferentiating an exposure level (an exposure time and intensity ofmeasurement light). Since sneaking light occurs in the partial region B,the measurement mode is set to the reflection/sneaking light removalmode (the fine mode). Further, in the partial region D, since the leveldifference is large, the Z-measurement range is enlarged to set themeasurement mode to the depth expanded measurement mode. In this way,the measurement setting suitable for the partial regions is set andsaved in advance and, in the continuous measurement mode for performinginspection of a large number of measurement objects, automaticadjustment of the measurement setting is omitted and the savedmeasurement setting is read out and used. Consequently, it is possibleto perform highly accurate measurement and inspection while reducing aprocessing time.

Guiding Section

In the continuous measurement mode, the position and the posture of themeasurement object need to be adjusted to be the same as a referenceposture, which is a position and a posture at the time when the savedpartial region measurement setting is set, when viewed from the imagingsection. Therefore, the shape measuring device may include a guidingsection that urges the user to dispose the measurement object in thesame position and the same posture as the reference posture. The guidingsection outputs, for example, on the display section, a guiding messagefor urging the user to dispose the measurement object in the sameposition and the same posture as the reference posture when the userplaces the measurement object on the stage 140.

Measurement-Object-Position-and-Posture Detecting Section

The shape measuring device may include ameasurement-object-position-and-posture detecting section that detectsthe position and the posture of the measurement object placed on thestage 140. The measurement-object-position-and-posture detecting sectionmay be configured to adjust, on the basis of the position and theposture of the measurement object during acquisition of the measurementsetting of the partial regions saved in the measurement-setting savingsection 243, by driving the plane-direction driving section, theposition and the posture of the measurement object detected by themeasurement-object-position-and-posture detecting section.

Positioning Jig

Alternatively, the position and the posture of the measurement objectmay be physically restricted using a positioning jig. The position andthe posture of the measurement object placed on the stage 140 ismatched, by the positioning jig, with the position and the posture ofthe measurement object during the acquisition of the measurement settingfor the partial regions saved in the measurement-setting saving section243.

Edge Extraction

In a state in which a three-dimensional image showing the measurementobject is acquired, the user can extract desired edges by designating anedge extraction target region on a texture image (e.g., FIG. 58) or aheight image (e.g., FIG. 59). The user can measure various geometricaldimensions such as length and an angle between edges and a radius of acircle by selecting, as a measurement element, a geometrical shapeobtained on the basis of the extracted edges. In this specification, aportion where a gray value or height steeply changes is referred to as“edge point” and a geometrical shape calculated by fitting, with apublicly-known method such as a method of least squares, a geometricalshape such as a circle or a straight line with an extracted plurality ofedge points is referred to as “edge”.

Edge Extraction Using Texture Information

An example in which edges are extracted using texture information isexplained with reference to an edge extraction screen 640 shown in FIG.60. In the edge extraction screen 640 shown in FIG. 60, as in FIG. 58and the like, the image display region 410 where a texture image and thelike are displayed is provided and the operation region 420 wherevarious kinds of operation are performed is provided on the right sideof the image display region 410. In the operation region 420, a methodselection field 642 for selecting a method of performing edge extractionis provided in the operation region 420. The user selects “texture” fromthe method selection field 642, whereby edge extraction using texture isperformed.

With the edge extraction using texture, edge points are extracted on thebasis of gray values of pixels forming a texture image. Specifically, inan edge extracting direction of a designated edge extraction region, aplurality of edge points where the gray values steeply change areextracted. A geometrical shape is fit with the extracted plurality ofedge points by an arithmetic operation such as the method of leastsquares to calculate edges. In the example shown in FIG. 60, an edgeextraction region ES1 sandwiched by an inner circle IC and an outercircle OC is set by the user. A radially extending direction from theinner circle IC to the outer circle OC is an edge extraction direction.

A state in which a circle is fit with the plurality of edge pointsextracted in this way is shown in FIG. 61. In the figure, the fit circleis displayed as an edge over the texture image displayed in the imagedisplay region 410. The user can select, as a measurement element set asa target of dimension measurement, the edge calculated in this way.

Edge Extraction Using Height Information

A method of extracting edges using height information is explained withreference to the edge extraction screen 640 shown in FIG. 62. Like theedge extraction using texture information explained above, first, inFIG. 62, the user selects “height” as a method of edge extraction fromthe method selection field 642 provided in the operation region 420. Inthe edge extraction using height, points where height steeply changes isextracted as edge points. Processing after the edge points are extractedis the same as the edge extraction using texture. In an example shown inFIG. 62, an edge ED1 of a column, the height of which steeply changes,is extracted using height information.

The edge extraction using texture information and the edge extractionusing height information are respectively effective for edge extractionof a part where a gray value steeply changes and edge extraction of apart where height steeply changes. However, when an edge extractionregion is set in a part where height gently changes, fluctuation occursin extracted edge points and the fitting of the geometrical shapebecomes unstable. Therefore, in this embodiment, it is possible toperform edge extraction using a profile of height. A procedure forperforming extraction of an edge using the height profile is explainedwith reference to an edge extraction screen 650 shown in FIG. 63.

Edge Extraction Using a Height Profile

In the edge extraction screen 650 shown in FIG. 63, as in FIG. 58 andthe like, the image display region 410 where an image and the like aredisplayed and the operation region 420 where various kinds of operationare performed are provided. In an example shown in FIG. 63, athree-dimensional image display region 652 where a three-dimensionalimage is displayed, a texture image display region 653 where a textureimage is displayed, and a height profile display region 654 where aheight profile is displayed are simultaneously displayed in theoperation region 420.

In the example shown in FIG. 63, a state is shown in which the innercircle IC and the outer circle OC are designated as an edge extractionregion ES2 in the texture image display region 653. Edges, the height ofwhich gently changes, are present between the inner circle IC and theouter circle OC of the edge extraction region ES2. In an example shownin FIG. 64, in the edge extraction region ES2, edge extraction lines ELset in in a direction from the outer circle OC to the inner circle ICare displayed over the texture image display region 653. As shown inFIG. 64, a state can be confirmed in which a plurality of edgeextraction lines EL are set in the direction from the outer circle OC tothe inner circle IC in an edge extraction region ES3. In this state, aheight profile HP corresponding to one edge extraction line SEL amongthe plurality of edge extraction lines EL is displayed in the heightprofile display region 654. It is easy to distinguish a currentlyselected edge extraction line SEL by highlighting the edge extractionline SEL in the texture image display region 653. In the example shownin FIG. 64, the currently selected edge extraction line SEL is displayedas a thick line. The user can change the height profile HP displayed inthe height profile display region 654 to any height profile by selectingany one of the edge extraction lines EL displayed in the texture imagedisplay region 653.

In this way, the user can define extraction rules for edge points on thebasis of the height profile HP displayed in the height profile displayregion 654. In an example shown in FIG. 65, linear element extractionranges LS1 and LS2 are respectively set in a bottom surface section andan inclined section of a measurement object. Straight lines arerespectively fit with height profiles HP in the set element extractionranges LS1 and LS2 to calculate two fitting straight lines FL1 and FL2.Further, an intersection CP1 of the calculated two fitting straightlines FL1 and FL2 is defined as an edge point.

Such extraction of edge points is also applied to other height profilesnot displayed in the height profile display region 654. A plurality ofedge points arranged in a substantially circular shape are extracted. Acircle can be fit with the extracted plurality of edge points.

The procedure of edge extraction explained above is an example. The usercan designate any element as an extraction element on a height profile.For example, the user may designate linear element extraction rangesrespectively in a bottom surface section and an upper surface section ofthe measurement object and extract, as an edge point, a point where amedian line of two straight lines and the height profile intersect.Alternatively, the user may designate an element extraction range formedby straight lines only in the bottom surface section of the measurementobject, generate an imaginary line offset by height set by the userupward from an extracted straight line, and extract, as an edge point, apoint where the imaginary line and the height profile intersect.

In this way, in this embodiment, the user can define the extractionrules for edge points by combining extraction elements on the heightprofile. Therefore, even when a part where height or a gray valuesteeply changes is absent, it is possible to stably extract edge pointsdesired by the user.

Height Profile Superimposed Display

Concerning all edge extraction lines in the set edge extraction region,height profiles can be superimposed and displayed in the height profiledisplay region 654. Such an example is shown in FIG. 66. In thisexample, all of the height profiles are fit in a frame indicating theelement extraction range LS1 in the bottom surface section of themeasurement object. However, since there is fluctuation in the height ofan inclined surface section, a part of the height profiles is not fit ina frame indicating the element extraction range LS2 of the inclinedsurface section. In this case, edge points are not extracted from theheight profiles not included in the element extraction range LS2. Acircle is fit on the basis of only extracted edge points. In this way,it is possible to prevent fluctuation in extracted edge points by notusing, for extraction of edge points, height profiles having heightfluctuation not included in the element extraction range.

Further, the element extraction range can be changed by the user. Forexample, a state in which the width of the element extraction range LS3is changed to include all of the height profiles in the inclined surfacesection in the example shown in FIG. 66 is shown in FIG. 67. In thiscase, the extraction of edge points is performed on the basis of alarger number of height profiles.

The extraction rules for edge points can be changed as appropriate. Forexample, when at least a part of the height profiles is included in theelement extraction range, the height profiles can be set to be used forthe extraction of edge points. On the other hand, when elements such asstraight lines are extracted and edge points are extracted from a smallnumber of height profiles and edge points, it is also likely thatfitting accuracy is deteriorated. Therefore, only when height profilesequal to or longer than a predetermined length are included in theelement extraction range, the height profiles may be used for theextraction of edge points.

Edge points greatly deviating from a fit geometrical shape such as acircle may be excluded as outliers. In this case, it is possible toimprove edge extraction accuracy of edges by fitting the geometricalshape again on the basis of edge points excluding the edge pointsexcluded as the outliers.

Further, an edge extraction result of the edges extracted in this waymay be confirmed in the texture image display region. For example, theextracted edges, the edge points on the edges, the edge points excludedas the outliers, and the edge extraction line on which edge points arenot extracted can be displayed in the texture image display region in adistinguishable state from one another.

Furthermore, the positions of the edge extraction elements on thetexture image or the height image and the extraction rules for edgepoints defined by the user on the height profile can also be saved as asetting file. Consequently, it is possible to repeatedly execute edgeextraction in the same part of the measurement object by placing themeasurement object on the stage in the same position and the sameposture or detecting the position and the posture of the measurementobject with a well-known search method.

The shape measuring device, the shape measuring method, the shapemeasuring program, and the computer-readable recording medium and thedevice having recorded therein the shape measuring program of thepresent invention can be suitably used in a microscope, a measuringinstrument, an inspection device, and a digitizer that make use of theprinciple of triangulation.

What is claimed is:
 1. A shape measuring device comprising: a stage onwhich a measurement object is placed; a light projecting sectionconfigured to irradiate pattern light on the measurement object placedon the stage; a light receiving section configured to receive thepattern light irradiated from the light projecting section and reflectedfrom the measurement object and output light reception data; anoptical-axis-direction driving section configured to relatively move thestage in an optical axis direction with respect to the light receivingsection to thereby adjust a focal position of the light receivingsection; a stage-plane-direction driving section configured torelatively move the stage in a stage plane direction orthogonal to anoptical axis direction of the light receiving section; a measurementsetting section for setting measurement setting including lightprojection setting for the pattern light of the light projecting sectionand light reception setting of the light receiving section; acoupled-region setting section configured to set, as a region where arelative position of the stage in the stage plane direction is moved bythe stage-plane-direction driving section, a coupled region formed by aplurality of partial regions; and a control section configured toexecute: stereoscopic-shape-data generation processing for generating,in the partial regions set by the coupled-region setting section,according to the measurement setting set by the measurement settingsection, on the basis of the light reception data output by the lightreceiving section, stereoscopic shape data indicating a shape of themeasurement object with a pattern projection method; measurement-settingadjustment processing for automatically adjusting the measurementsetting for the partial regions on the basis of at least one ofstereoscopic shape data of the partial regions and the light receptiondata acquired in the partial regions when the stereoscopic shape data isgenerated; and stereoscopic-shape-data coupling processing for coupling,according to the measurement setting for the partial regions adjusted bythe measurement-setting adjustment processing, the stereoscopic shapedata of the partial regions generated again by thestereoscopic-shape-data generation processing and generating coupledstereoscopic shape data corresponding to the coupled region.
 2. Theshape measuring device according to claim 1, wherein the control sectionincludes, as the measurement setting for the partial regions, at leastone of a measurement mode in generating the stereoscopic shape data ofthe measurement object in the stereoscopic-shape-data generationprocessing, illumination intensity of the light projecting section, anexposure time of the light receiving section, and adjustment of thefocal position of the light receiving section.
 3. The shape measuringdevice according to claim 1, wherein, when detecting at least one ofsneaking and multiple reflection of the pattern light from missing dataincluded in the stereoscopic shape data or the light reception data, thecontrol section selects a measurement mode corresponding to the patternlight sneaking or multiple reflection to make it possible to adjust themeasurement setting for the partial regions.
 4. The shape measuringdevice according to claim 1, wherein, on the basis of presence orabsence of a signal component in a change of a luminance value of apixel forming the light reception data, the control section determinesthat the sneaking of the pattern light occurs when a fixed signalcomponent is confirmed and determines that a void is present when thefixed signal component is not confirmed, detects one of sneaking andmultiple reflection of light on the basis of a result of thedetermination, and selects a measurement mode corresponding to thesneaking or the multiple reflection of the light to make it possible toadjust the measurement setting for the partial regions.
 5. The shapemeasuring device according to claim 1, wherein the control sectionperforms adjustment of an exposure time on the basis of the lightreception data to make it possible to adjust the measurement setting forthe partial regions.
 6. The shape measuring device according to claim 1,wherein the control section shifts the focal position on the basis of atleast one of the light reception data and the stereoscopic shape data tomake it possible to adjust the measurement setting for the partialregions.
 7. The shape measuring device according to claim 1, wherein thecontrol section expands a depth measurement range, which is a heightrange in which the pattern light can be irradiated from the lightprojecting section, to make it possible to adjust the measurementsetting for the partial regions.
 8. The shape measuring device accordingto claim 1, wherein the light projecting section includes: a first lightprojecting section configured to irradiate, from a first direction,first pattern light on the measurement object placed on the stage; and asecond light projecting section configured to irradiate, from a seconddirection, second pattern light on the measurement object placed on thestage, the light receiving section receives the first pattern lightirradiated from the first light projecting section and reflected fromthe measurement object and outputs first light reception data andreceives the second pattern light irradiated from the second lightprojecting section and reflected from the measurement object and outputssecond light reception data, the stereoscopic-shape-data generatingprocessing generates first direction stereoscopic shape data of themeasurement object on the basis of the first light reception datareceived by the light receiving section and generates second directionstereoscopic shape data of the measurement object on the basis of thesecond light reception data received by the light receiving section, andthe control section selects one or both of the first light projectingsection and the second light projecting section on the basis of thelight reception data to make it possible to adjust the measurementsetting for the partial regions.
 9. The shape measuring device accordingto claim 1, further comprising a measurement-setting saving section forsaving the measurement setting for the partial regions adjusted by thecontrol section, wherein the control section couples, according to themeasurement setting for the partial regions saved in themeasurement-setting saving section, the stereoscopic shape data of thepartial regions generated again by the stereoscopic-shape-datageneration processing and generates the coupled stereoscopic shape datacorresponding to the coupled region.
 10. A shape measuring devicecomprising: a stage on which a measurement object is placed; a lightprojecting section configured to irradiate pattern light on themeasurement object placed on the stage; a light receiving sectionconfigured to receive the pattern light irradiated from the lightprojecting section and reflected from the measurement object and outputlight reception data; an optical-axis-direction driving sectionconfigured to relatively move the stage in an optical axis directionwith respect to the light receiving section to thereby adjust a focalposition of the light receiving section; a stage-plane-direction drivingsection configured to relatively move the stage in a stage planedirection orthogonal to an optical axis direction of the light receivingsection; a coupled-region setting section configured to set, as a regionwhere a relative position of the stage in the stage plane direction ismoved by the stage-plane-direction driving section, a coupled regionformed by a plurality of partial regions; a stereoscopic-shape-datagenerating section configured to generate, in the partial regions set bythe coupled-region setting section, according to the measurement settingset by the measurement setting section, on the basis of the lightreception data output by the light receiving section, stereoscopic shapedata indicating a shape of the measurement object with a patternprojection method; a measurement setting section for setting, as partialregion measurement setting, for each of the partial regions, measurementsetting including light projection setting for the pattern light of thelight projecting section and light reception setting for a pattern imageof the light receiving section; a measurement-setting saving section forsaving, in association with the partial regions, partial regionmeasurement setting for the partial regions set by the measurementsetting section; and a stereoscopic-shape-data coupling sectionconfigured to couple, according to the measurement setting for thepartial regions saved in the measurement-setting saving section, thestereoscopic shape data of the partial regions generated again by thestereoscopic-shape-data generating section and generate coupledstereoscopic shape data corresponding to the coupled region.
 11. Theshape measuring device according to claim 9, further comprising ameasurement-mode selecting section for selecting, as a measurement modein generating the stereoscopic shape data of the measurement object inthe stereoscopic-shape-data generation processing, any one of a normalmode, a fine mode for performing finer measurement than the normal mode,and a halation removal mode for removing halation from the lightreception data.
 12. The shape measuring device according to claim 9,wherein the stereoscopic-shape-data generating section is capable ofswitching a normal measurement mode for changing partial regionmeasurement setting for each of the partial regions with the controlsection and generating the stereoscopic shape data and a continuousmeasurement mode for reading out, for each of the partial regions, thepartial region measurement setting saved in the measurement-settingsaving section in advance and generating the stereoscopic shape data.13. The shape measuring device according to claim 9, further comprisinga guiding section configured to output a guiding message to dispose themeasurement object on the stage in a same position and a same posture asa reference posture, which is a position and a posture of themeasurement object during the acquisition of the measurement setting forthe partial regions saved in the measurement-setting saving section. 14.The shape measuring device according to claim 9, further comprising ameasurement-object-position-and-posture detecting section configured todetect a position and a posture of the measurement object placed on thestage, wherein the shape measuring device drives thestage-plane-direction driving section to adjust, on the basis of aposition and a posture of the measurement object during the acquisitionof the measurement setting for the partial regions saved in themeasurement-setting saving section, the position and the posture of themeasurement object detected by themeasurement-target-position-and-posture detecting section.
 15. The shapemeasuring device according to claim 9, further comprising a positioningjig for matching a position and a posture of the measurement objectplaced on the stage with a position and a posture of the measurementobject during the acquisition of the measurement setting for the partialregions saved in the measurement-setting saving section.
 16. The shapemeasuring device according to claim 1, further comprising atexture-image acquiring section for acquiring a texture image, which isa two-dimensional optical image, having texture information of themeasurement object placed on the stage, wherein at least a part oftexture image capturing conditions in capturing a plurality of textureimages with the texture-image acquiring section is common to the partialregions.
 17. The shape measuring device according to claim 16, whereinas one of the texture image capturing conditions in capturing aplurality of texture images with the texture-image acquiring section, anexposure time is common to the partial regions, and As one kind of thepartial region measurement setting in generating a plurality ofstereoscopic shape data with the stereoscopic-shape-data generationprocessing, the exposure time is adjustable by the control section. 18.The shape measuring device according to claim 16, wherein theoptical-axis-direction driving section independently adjusts relativepositions in an optical axis direction of the stage in capturing aplurality of texture images with the texture-image acquiring section andrelative positions in the optical axis direction of the stage ingenerating a plurality of stereoscopic shape data with thestereoscopic-shape-data generation processing.
 19. The shape measuringdevice according to claim 1, further comprising: a determinationprocessing section configured to determine, on the basis of thestereoscopic shape data acquired by the stereoscopic-shape-datagenerating section, according to predetermined determination conditions,whether an unmeasured region not having height information is present inthe depth measurement range; a focal-position changing sectionconfigured to control the optical-axis-direction driving section tochange the focal position of the light receiving section when it isdetermined by un-measurement determination processing by thedetermination processing section that the unmeasured region is present;and a synthesis processing section configured to generate a synthesizedstereoscopic shape data obtained by combining a plurality ofstereoscopic shape data generated by automatically repeatingstereoscopic-shape-data acquisition processing by thestereoscopic-shape-data generating section, the un-measurementdetermination processing by the determination processing section, andfocal-position changing processing by the focal-position changingsection until it is determined by the un-measurement determinationprocessing by the determination processing section that an unmeasuredregion is absent or a predetermined end condition is satisfied.
 20. Ashape measuring method for performing measurement of a shape of ameasurement object, the shape measuring method comprising: dividing animage showing a measurement object placed on a stage into a plurality ofpartial regions and relatively moving the stage with astage-plane-direction driving section in a stage plane directionorthogonal to an optical axis direction of a light receiving section toa first region, which is one of the plurality of divided partialregions; projecting pattern light on the measurement object from a lightprojecting section according to first region measurement setting, whichis measurement setting including light projection setting for thepattern light of the light projecting section and light receptionsetting of the light receiving section in the first region, receivingthe pattern light reflected from the measurement object with the lightreceiving section and acquiring first light reception data, andgenerating, on the basis of the first light reception data, with astereoscopic-shape-data generating section, first stereoscopic shapedata indicating a shape of the first region with a pattern projectionmethod; saving the first stereoscopic shape data or the first lightreception data in a storing section in association with the first regionand automatically adjusting, with a measurement-setting automaticallyadjusting section, the first region measurement setting to optimizedfirst region adjusted measurement setting on the basis of the firststereoscopic shape data or the first light reception data; relativelymoving the stage with a stage-plane-direction driving section to asecond region, which is another one of the partial regions; projectingthe pattern light on the measurement object from the light projectingsection according to second region measurement setting, which ismeasurement setting including light projection setting for the patternlight of the light projecting section and light reception setting of thelight receiving section in the second region, receiving the patternlight reflected from the measurement object with the light receivingsection and acquiring second light reception data, and generating, onthe basis of the second light reception data, with thestereoscopic-shape-data generation processing, second stereoscopic shapedata indicating a shape of the second region with the pattern projectionmethod; saving the second stereoscopic shape data or the second lightreception data in the storing section in association with the secondregion and automatically adjusting, with a control section, the secondregion measurement setting to optimized second region adjustedmeasurement setting on the basis of the second stereoscopic shape dataor the second light reception data; and coupling, according to apositional relation among the partial regions, a plurality ofstereoscopic shape data including the first stereoscopic shape data andthe second stereoscopic shape data saved in the storing section andgenerating, with a stereoscopic-shape-data coupling section, coupledstereoscopic shape data corresponding to the coupled region.